Hi,

The table_stats_reply has a stats attribute, which contains an array of 
ofp_table_stats. The max_entries attribute is in ofp_table_stats.

Regards,
Zoltan.
________________________________________
From: openflow-discuss-boun...@lists.stanford.edu 
[openflow-discuss-boun...@lists.stanford.edu] On Behalf Of shreya pandita 
[shreya.pand...@gmail.com]
Sent: Thursday, July 05, 2012 9:25 PM
To: openflow-discuss@lists.stanford.edu
Subject: [openflow-discuss] oftest for TestCounters

Hi All,

I am trying to write a test-case, in which the controller will send a 
table_stats_request , the switch should reply back with a table_stats_reply .
Also, the table_stats_reply should contain the counters like :


class TableCounter(basic.SimpleProtocol):
    """
    Test Counters
    """
    def runTest(self):
        tc_logger.info<http://tc_logger.info>("Running TableCounter")
        tc_logger.info<http://tc_logger.info>("Inserting trial flow")
        request = flow_mod_gen(tc_port_map, True)
        rv = self.controller.message_send(request)
        self.assertTrue(rv != -1, "Failed to insert test flow")

        tc_logger.info<http://tc_logger.info>("Sending table stats request")
        request = message.table_stats_request()
        response, pkt = self.controller.transact(request, timeout=2)
        self.assertTrue(response is not None, "Did not get response")
        self.assertTrue(response.max_entries is not None "did not receive 
max_entries")
        self.assertTrue(response.active_count is not None  "did not receive 
active entries")
        self.assertTrue(response.table_id is not None  "did not receive the 
table id ")
        tc.debug(response.show())


I get this error:
AttributeError: table_stats_reply instance has no attribute 'max_entries'
Though the Wireshark trace for table_stats_reply shows that the switch replies 
back with these fields .

_______________________________________________
openflow-discuss mailing list
openflow-discuss@lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss

Reply via email to