Rich Lane | 1ab6f83 | 2013-05-03 17:51:35 -0700 | [diff] [blame^] | 1 | """ |
| 2 | Basic test cases |
| 3 | |
| 4 | Test cases in other modules depend on this functionality. |
| 5 | """ |
| 6 | |
| 7 | from oftest import config |
| 8 | import oftest.base_tests as base_tests |
| 9 | import ofp |
| 10 | |
| 11 | from oftest.testutils import * |
| 12 | |
| 13 | @group('smoke') |
| 14 | class Echo(base_tests.SimpleProtocol): |
| 15 | """ |
| 16 | Test echo response with no data |
| 17 | """ |
| 18 | def runTest(self): |
| 19 | request = ofp.message.echo_request() |
| 20 | response, pkt = self.controller.transact(request) |
| 21 | self.assertTrue(response is not None, |
| 22 | "Did not get echo reply") |
| 23 | self.assertEqual(response.type, ofp.OFPT_ECHO_REPLY, |
| 24 | 'response is not echo_reply') |
| 25 | self.assertEqual(request.xid, response.xid, |
| 26 | 'response xid != request xid') |
| 27 | self.assertEqual(len(response.data), 0, 'response data non-empty') |