Shudong Zhou | dc276ae | 2012-10-15 16:02:56 -0700 | [diff] [blame] | 1 | """ |
| 2 | """ |
| 3 | import struct |
| 4 | |
| 5 | import logging |
| 6 | |
| 7 | from oftest import config |
| 8 | import oftest.controller as controller |
Rich Lane | d7b0ffa | 2013-03-08 15:53:42 -0800 | [diff] [blame] | 9 | import ofp |
Shudong Zhou | dc276ae | 2012-10-15 16:02:56 -0700 | [diff] [blame] | 10 | import oftest.base_tests as base_tests |
| 11 | |
| 12 | from oftest.testutils import * |
| 13 | |
Rich Lane | 4b60145 | 2013-03-11 23:37:06 -0700 | [diff] [blame] | 14 | NX_ROLE_MASTER = 2 |
Shudong Zhou | dc276ae | 2012-10-15 16:02:56 -0700 | [diff] [blame] | 15 | |
Rich Lane | 0a4f637 | 2013-01-02 14:40:22 -0800 | [diff] [blame] | 16 | @nonstandard |
Shudong Zhou | dc276ae | 2012-10-15 16:02:56 -0700 | [diff] [blame] | 17 | class NiciraRoleRequest(base_tests.SimpleDataPlane): |
| 18 | """ |
| 19 | Exercise Nicira vendor extension for requesting HA roles |
| 20 | """ |
| 21 | |
Shudong Zhou | dc276ae | 2012-10-15 16:02:56 -0700 | [diff] [blame] | 22 | def runTest(self): |
| 23 | ''' |
| 24 | For now, we only verify that a response is received. |
| 25 | ''' |
Rich Lane | 4b60145 | 2013-03-11 23:37:06 -0700 | [diff] [blame] | 26 | request = ofp.message.nicira_controller_role_request(role=NX_ROLE_MASTER) |
Shudong Zhou | dc276ae | 2012-10-15 16:02:56 -0700 | [diff] [blame] | 27 | response, pkt = self.controller.transact(request) |
| 28 | self.assertTrue(response is not None, "No reply to Nicira role request") |