use per-type error msg classes
diff --git a/tests-1.3/groups.py b/tests-1.3/groups.py
index 83c4941..423e66e 100644
--- a/tests-1.3/groups.py
+++ b/tests-1.3/groups.py
@@ -89,8 +89,7 @@
ofp.bucket(actions=[ofp.action.output(ofp.OFPP_ANY)])])
response, _ = self.controller.transact(msg)
- self.assertIsInstance(response, ofp.message.error_msg)
- self.assertEquals(response.err_type, ofp.OFPET_BAD_ACTION)
+ self.assertIsInstance(response, ofp.message.bad_action_error_msg)
self.assertEquals(response.code, ofp.OFPBAC_BAD_OUT_PORT)
@@ -120,8 +119,7 @@
ofp.bucket(actions=[ofp.action.output(port2)])])
response, _ = self.controller.transact(msg)
- self.assertIsInstance(response, ofp.message.error_msg)
- self.assertEquals(response.err_type, ofp.OFPET_GROUP_MOD_FAILED)
+ self.assertIsInstance(response, ofp.message.group_mod_failed_error_msg)
self.assertEquals(response.code, ofp.OFPGMFC_GROUP_EXISTS)
@@ -141,8 +139,7 @@
ofp.bucket(actions=[ofp.action.output(port1)])])
response, _ = self.controller.transact(msg)
- self.assertIsInstance(response, ofp.message.error_msg)
- self.assertEquals(response.err_type, ofp.OFPET_GROUP_MOD_FAILED)
+ self.assertIsInstance(response, ofp.message.group_mod_failed_error_msg)
self.assertEquals(response.code, ofp.OFPGMFC_INVALID_GROUP)
@@ -162,8 +159,7 @@
ofp.bucket(actions=[ofp.action.output(port1)])])
response, _ = self.controller.transact(msg)
- self.assertIsInstance(response, ofp.message.error_msg)
- self.assertEquals(response.err_type, ofp.OFPET_GROUP_MOD_FAILED)
+ self.assertIsInstance(response, ofp.message.group_mod_failed_error_msg)
self.assertEquals(response.code, ofp.OFPGMFC_INVALID_GROUP)
@@ -219,8 +215,7 @@
ofp.bucket(actions=[ofp.action.output(port1)])])
response, _ = self.controller.transact(msg)
- self.assertIsInstance(response, ofp.message.error_msg)
- self.assertEquals(response.err_type, ofp.OFPET_GROUP_MOD_FAILED)
+ self.assertIsInstance(response, ofp.message.group_mod_failed_error_msg)
self.assertEquals(response.code, ofp.OFPGMFC_UNKNOWN_GROUP)
@@ -270,8 +265,7 @@
ofp.bucket(actions=[ofp.action.group(2)])])
response, _ = self.controller.transact(msg)
- self.assertIsInstance(response, ofp.message.error_msg)
- self.assertEquals(response.err_type, ofp.OFPET_GROUP_MOD_FAILED)
+ self.assertIsInstance(response, ofp.message.group_mod_failed_error_msg)
self.assertEquals(response.code, ofp.OFPGMFC_LOOP)
@@ -291,8 +285,7 @@
ofp.bucket(actions=[ofp.action.output(port1)])])
response, _ = self.controller.transact(msg)
- self.assertIsInstance(response, ofp.message.error_msg)
- self.assertEquals(response.err_type, ofp.OFPET_GROUP_MOD_FAILED)
+ self.assertIsInstance(response, ofp.message.group_mod_failed_error_msg)
self.assertEquals(response.code, ofp.OFPGMFC_INVALID_GROUP)
@@ -431,8 +424,7 @@
ofp.bucket(weight=2, actions=[ofp.action.output(port2)])])
response, _ = self.controller.transact(msg)
- self.assertIsInstance(response, ofp.message.error_msg)
- self.assertEquals(response.err_type, ofp.OFPET_GROUP_MOD_FAILED)
+ self.assertIsInstance(response, ofp.message.group_mod_failed_error_msg)
self.assertEquals(response.code, ofp.OFPGMFC_INVALID_GROUP)
@@ -452,8 +444,7 @@
ofp.bucket(weight=1, actions=[ofp.action.output(port1)])])
response, _ = self.controller.transact(msg)
- self.assertIsInstance(response, ofp.message.error_msg)
- self.assertEquals(response.err_type, ofp.OFPET_GROUP_MOD_FAILED)
+ self.assertIsInstance(response, ofp.message.group_mod_failed_error_msg)
self.assertEquals(response.code, ofp.OFPGMFC_INVALID_GROUP)
@@ -474,8 +465,7 @@
ofp.bucket(actions=[ofp.action.output(port2)])])
response, _ = self.controller.transact(msg)
- self.assertIsInstance(response, ofp.message.error_msg)
- self.assertEquals(response.err_type, ofp.OFPET_GROUP_MOD_FAILED)
+ self.assertIsInstance(response, ofp.message.group_mod_failed_error_msg)
self.assertEquals(response.code, ofp.OFPGMFC_INVALID_GROUP)
@@ -496,8 +486,7 @@
ofp.bucket(actions=[ofp.action.output(port2)])])
response, _ = self.controller.transact(msg)
- self.assertIsInstance(response, ofp.message.error_msg)
- self.assertEquals(response.err_type, ofp.OFPET_GROUP_MOD_FAILED)
+ self.assertIsInstance(response, ofp.message.group_mod_failed_error_msg)
self.assertEquals(response.code, ofp.OFPGMFC_INVALID_GROUP)
diff --git a/tests/nicira_role.py b/tests/nicira_role.py
index 5eeca25..7f2c5c8 100644
--- a/tests/nicira_role.py
+++ b/tests/nicira_role.py
@@ -40,10 +40,9 @@
logging.info("Role reply received")
logging.info(response.show())
self.assertEquals(response.role, NX_ROLE_MASTER)
- elif isinstance(response, ofp.message.error_msg):
+ elif isinstance(response, ofp.message.bad_request_error_msg):
logging.info("Error message received")
logging.info(response.show())
- self.assertEquals(response.err_type, ofp.OFPET_BAD_REQUEST)
self.assertEquals(response.code, ofp.OFPBRC_BAD_VENDOR)
else:
raise AssertionError("Unexpected reply type")
@@ -79,7 +78,7 @@
err_count = 0
while self.controller.packets:
msg = self.controller.packets.pop(0)[0]
- if isinstance(msg, ofp.message.error_msg):
+ if msg.type == ofp.OFPT_ERROR:
self.assertEquals(msg.err_type, ofp.OFPET_BAD_REQUEST)
self.assertEquals(msg.code, ofp.OFPBRC_EPERM)
err_count += 1
@@ -172,7 +171,7 @@
err_count = 0
while con.packets:
msg = con.packets.pop(0)[0]
- if isinstance(msg, ofp.message.error_msg):
+ if msg.type == ofp.OFPT_ERROR:
self.assertEquals(msg.err_type, ofp.OFPET_BAD_REQUEST)
self.assertEquals(msg.code, ofp.OFPBRC_EPERM)
err_count += 1