add flow_stats.EmptyFlowStats
diff --git a/tests/flow_stats.py b/tests/flow_stats.py
index 4810b17..8ca0bc8 100644
--- a/tests/flow_stats.py
+++ b/tests/flow_stats.py
@@ -407,6 +407,27 @@
self.verifyAggFlowStats(match, egress_port2, test_timeout,
1, num_pkt2s)
+class EmptyFlowStats(base_tests.SimpleDataPlane):
+ """
+ Verify the switch replies to a flow stats request when
+ the query doesn't match any flows.
+ """
+ def runTest(self):
+ rc = delete_all_flows(self.controller)
+ self.assertEqual(rc, 0, "Failed to delete all flows")
+ match = ofp.ofp_match()
+ match.wildcards = 0
+ stat_req = message.flow_stats_request()
+ stat_req.match = match
+ stat_req.table_id = 0xff
+ stat_req.out_port = ofp.OFPP_NONE
+
+ response, pkt = self.controller.transact(stat_req)
+ self.assertTrue(response is not None,
+ "No response to stats request")
+ self.assertEquals(len(response.stats), 0)
+ self.assertEquals(response.flags, 0)
+
class EmptyAggregateStats(base_tests.SimpleDataPlane):
"""
Verify aggregate flow stats are properly retrieved when