+OVSDB_CHECK_MONITOR([monitor insert-update-and-delete transaction],
+ [ordinal_schema],
+ [[[["ordinals",
+ {"op": "insert",
+ "table": "ordinals",
+ "row": {"number": 10, "name": "ten"}}]]]],
+ [ordinals], [ordinals],
+ [[[["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"}}]]]],
+ [[row,action,name,number,_version
+<0>,initial,"""ten""",10,"[""uuid"",""<1>""]"
+
+row,action,name,number,_version
+<2>,insert,"""seven""",7,"[""uuid"",""<3>""]"
+]])
+\f
+AT_BANNER([ovsdb -- ovsdb-monitor monitor only some operations])
+
+m4_define([OVSDB_MONITOR_INITIAL],
+ [[[["ordinals",
+ {"op": "insert",
+ "table": "ordinals",
+ "row": {"number": 10, "name": "ten"}}]]]])
+m4_define([OVSDB_MONITOR_TXNS],
+ [[[["ordinals",
+ {"op": "insert",
+ "table": "ordinals",
+ "row": {"number": 5, "name": "five"}}]]],
+ [[["ordinals",
+ {"op": "update",
+ "table": "ordinals",
+ "where": [["name", "==", "five"]],
+ "row": {"name": "FIVE"}}]]],
+ [[["ordinals",
+ {"op": "delete",
+ "table": "ordinals",
+ "where": []}]]]])
+
+OVSDB_CHECK_MONITOR([monitor all operations],
+ [ordinal_schema], [OVSDB_MONITOR_INITIAL],
+ [ordinals], [ordinals], [OVSDB_MONITOR_TXNS],
+ [[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>""]"
+]])
+
+dnl A monitor with "initial" only doesn't really make sense,
+dnl but it's still allowed and should work.
+OVSDB_CHECK_MONITOR([monitor initial only],
+ [ordinal_schema], [OVSDB_MONITOR_INITIAL],
+ [ordinals], [ordinals], [OVSDB_MONITOR_TXNS],
+ [[row,action,name,number,_version
+<0>,initial,"""ten""",10,"[""uuid"",""<1>""]"
+]], [!insert,!delete,!modify])
+
+OVSDB_CHECK_MONITOR([monitor insert only],
+ [ordinal_schema], [OVSDB_MONITOR_INITIAL],
+ [ordinals], [ordinals], [OVSDB_MONITOR_TXNS],
+ [[row,action,name,number,_version
+<0>,insert,"""five""",5,"[""uuid"",""<1>""]"
+]], [!initial,!delete,!modify])
+
+OVSDB_CHECK_MONITOR([monitor delete only],
+ [ordinal_schema], [OVSDB_MONITOR_INITIAL],
+ [ordinals], [ordinals], [OVSDB_MONITOR_TXNS],
+ [[row,action,name,number,_version
+<0>,delete,"""FIVE""",5,"[""uuid"",""<1>""]"
+<2>,delete,"""ten""",10,"[""uuid"",""<3>""]"
+]], [!initial,!insert,!modify])
+
+OVSDB_CHECK_MONITOR([monitor modify only],
+ [ordinal_schema], [OVSDB_MONITOR_INITIAL],
+ [ordinals], [ordinals], [OVSDB_MONITOR_TXNS],
+ [[row,action,name,number,_version
+<0>,old,"""five""",,"[""uuid"",""<1>""]"
+,new,"""FIVE""",5,"[""uuid"",""<2>""]"
+]], [!initial,!insert,!delete])