From 8419883d698965962e37b024cfb7f2f0ccba376f Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 17 Dec 2009 15:49:48 -0800 Subject: [PATCH] testsuite: Look for .ovsschema files in source dir as well as build dir. When a distribution is built with "make dist", the .ovsschema files are included as part of it, so that the builder does not have to have Python installed. However in that case the distributed .ovsschema files are in the source dir instead of the build dir. The testsuite always expected them in the latter directory. This commit makes it look for them in both places. --- tests/ovs-vsctl.at | 10 +++++++++- tests/ovsdb-idl.at | 13 +++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at index b1e79484..6e968f06 100644 --- a/tests/ovs-vsctl.at +++ b/tests/ovs-vsctl.at @@ -4,7 +4,15 @@ dnl Creates an empty database in the current directory and then starts dnl an ovsdb-server on it for ovs-vsctl to connect to. m4_define([OVS_VSCTL_SETUP], [OVS_CHECK_LCOV( - [ovsdb-tool create db $abs_builddir/../vswitchd/vswitch-idl.ovsschema], + [SCHEMA=$abs_top_builddir/vswitchd/vswitch-idl.ovsschema + if test ! -e $SCHEMA; then + SCHEMA=$abs_top_srcdir/vswitchd/vswitch-idl.ovsschema + if test ! -e $SCHEMA; then + echo 'Failed to find vswitch-idl.ovsschema' + exit 1 + fi + fi + ovsdb-tool create db $SCHEMA], [0], [stdout], [ignore]) OVS_CHECK_LCOV( [[ovsdb-tool transact db \ diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at index 973ccac8..b1c78e00 100644 --- a/tests/ovsdb-idl.at +++ b/tests/ovsdb-idl.at @@ -17,8 +17,17 @@ AT_BANNER([OVSDB -- interface description language (IDL)]) m4_define([OVSDB_CHECK_IDL], [AT_SETUP([$1]) AT_KEYWORDS([ovsdb server idl positive $5]) - OVS_CHECK_LCOV([ovsdb-tool create db $abs_builddir/idltest.ovsschema], - [0], [stdout], [ignore]) + OVS_CHECK_LCOV( + [SCHEMA=$abs_builddir/idltest.ovsschema + if test ! -e $SCHEMA; then + SCHEMA=$abs_srcdir/idltest.ovsschema + if test ! -e $SCHEMA; then + echo 'Failed to find idltest.ovsschema' + exit 1 + fi + fi + ovsdb-tool create db $SCHEMA], + [0], [stdout], [ignore]) AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --pidfile=$PWD/server-pid --listen=punix:socket --unixctl=$PWD/unixctl db], [0], [ignore], [ignore]) m4_if([$2], [], [], [OVS_CHECK_LCOV([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore], [kill `cat server-pid`])]) -- 2.30.2