loxi-prep: singleton stats replies do not use arrays
diff --git a/tests/flow_stats.py b/tests/flow_stats.py
index 63911e6..ff33948 100644
--- a/tests/flow_stats.py
+++ b/tests/flow_stats.py
@@ -339,15 +339,12 @@
timeout=test_timeout)
self.assertTrue(response is not None,
"No response to stats request")
- self.assertTrue(len(response.entries) == 1,
- "Did not receive flow stats reply")
- for obj in response.entries:
- self.assertTrue(obj.flow_count == flow_count,
- "Flow count " + str(obj.flow_count) +
- " does not match expected " + str(flow_count))
- logging.info("Received " + str(obj.packet_count) + " packets")
- if obj.packet_count == packet_count:
- all_packets_received = 1
+ self.assertTrue(response.flow_count == flow_count,
+ "Flow count " + str(response.flow_count) +
+ " does not match expected " + str(flow_count))
+ logging.info("Received " + str(response.packet_count) + " packets")
+ if response.packet_count == packet_count:
+ all_packets_received = 1
if all_packets_received:
break
@@ -441,11 +438,9 @@
response, pkt = self.controller.transact(stat_req)
self.assertTrue(response is not None,
"No response to stats request")
- self.assertTrue(len(response.entries) == 1,
- "Did not receive flow stats reply")
- self.assertEquals(response.entries[0].flow_count, 0)
- self.assertEquals(response.entries[0].packet_count, 0)
- self.assertEquals(response.entries[0].byte_count, 0)
+ self.assertEquals(response.flow_count, 0)
+ self.assertEquals(response.packet_count, 0)
+ self.assertEquals(response.byte_count, 0)
class DeletedFlowStats(base_tests.SimpleDataPlane):
"""
diff --git a/tests/message_types.py b/tests/message_types.py
index b214dc6..599764a 100644
--- a/tests/message_types.py
+++ b/tests/message_types.py
@@ -676,26 +676,12 @@
response, pkt = self.controller.transact(request)
self.assertTrue(response is not None,
"Did not get reply for desc stats")
-
- mfr_desc = ""
- hw_desc = ""
- sw_dec = ""
- serial_num = ""
- dp_decription = ""
- for stats in response.entries:
-
- mfr_desc += stats.mfr_desc
- hw_desc += stats.hw_desc
- sw_dec += stats.sw_desc
- serial_num += stats.serial_num
- dp_decription += stats.dp_desc
-
- logging.info("Manufacture Description :" + mfr_desc)
- logging.info("Hardware description : " + hw_desc)
- logging.info("Software Description :" + sw_dec)
- logging.info("Serial number :" + serial_num)
- logging.info("Human readable description of datapath :" + dp_decription)
+ logging.info("Manufacture Description :" + response.mfr_desc)
+ logging.info("Hardware description : " + response.hw_desc)
+ logging.info("Software Description :" + response.sw_desc)
+ logging.info("Serial number :" + response.serial_num)
+ logging.info("Human readable description of datapath :" + response.dp_desc)