Cleanly separate IDL annotations from OVSDB schema information.
[sliver-openvswitch.git] / tests / ovsdb-macros.at
1 dnl OVSDB_INIT([$1])
2 dnl
3 dnl Creates an empty database named $1.
4 m4_define([OVSDB_INIT],
5   [OVS_CHECK_LCOV(
6      [SCHEMA=$abs_top_builddir/vswitchd/vswitch-idl.ovsschema
7       if test ! -e $SCHEMA; then
8         SCHEMA=$abs_top_srcdir/vswitchd/vswitch-idl.ovsschema
9           if test ! -e $SCHEMA; then
10             echo 'Failed to find vswitch-idl.ovsschema'
11             exit 1
12           fi
13       fi
14       ovsdb-tool create $1 $abs_top_srcdir/vswitchd/vswitch.ovsschema],
15      [0], [stdout], [ignore])
16    OVS_CHECK_LCOV(
17      [[ovsdb-tool transact $1 \
18         '[{"op": "insert",
19            "table": "Open_vSwitch",
20            "row": {}}]']],
21      [0], [ignore], [ignore])])