blob: 1122a7b35f61627242e2f5c82079da39f13137a8 [file] [log] [blame]
Shudong Zhoudc276ae2012-10-15 16:02:56 -07001"""
2"""
3import struct
4
5import logging
6
7from oftest import config
8import oftest.controller as controller
Rich Laned7b0ffa2013-03-08 15:53:42 -08009import ofp
Shudong Zhoudc276ae2012-10-15 16:02:56 -070010import oftest.base_tests as base_tests
11
12from oftest.testutils import *
13
Rich Lane4b601452013-03-11 23:37:06 -070014NX_ROLE_MASTER = 2
Shudong Zhoudc276ae2012-10-15 16:02:56 -070015
Rich Lane0a4f6372013-01-02 14:40:22 -080016@nonstandard
Shudong Zhoudc276ae2012-10-15 16:02:56 -070017class NiciraRoleRequest(base_tests.SimpleDataPlane):
18 """
19 Exercise Nicira vendor extension for requesting HA roles
20 """
21
Shudong Zhoudc276ae2012-10-15 16:02:56 -070022 def runTest(self):
23 '''
24 For now, we only verify that a response is received.
25 '''
Rich Lane4b601452013-03-11 23:37:06 -070026 request = ofp.message.nicira_controller_role_request(role=NX_ROLE_MASTER)
Shudong Zhoudc276ae2012-10-15 16:02:56 -070027 response, pkt = self.controller.transact(request)
28 self.assertTrue(response is not None, "No reply to Nicira role request")