From 7ddee99fbf1339af808ab894f3965373628663e6 Mon Sep 17 00:00:00 2001 From: wangqun Date: Thu, 10 Mar 2016 08:31:42 +0000 Subject: [PATCH] Fix baymodel with invalid parameter can updated. Now, when we update baymodel with the invalid flavor_id or master_flavor_id parameters, the baymodel can be updated successfully. We need to validate the flavor_id, master_flavor, keypair and so on before patching baymodel. Closes-Bug: #1555490 Change-Id: I4ae3cd7c0be1161dacb6f0a80c5ee1b53d06d03d --- magnum/tests/functional/api/v1/test_bay.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/magnum/tests/functional/api/v1/test_bay.py b/magnum/tests/functional/api/v1/test_bay.py index 6079806..6c043b5 100644 --- a/magnum/tests/functional/api/v1/test_bay.py +++ b/magnum/tests/functional/api/v1/test_bay.py @@ -177,17 +177,8 @@ class BayTest(base.BaseMagnumTest): self.assertEqual(resp.status, 201) self.assertIsNotNone(baymodel.uuid) - patch_model = datagen.baymodel_flavor_patch_data() - resp, new_model = self.baymodel_client.patch_baymodel( - baymodel.uuid, patch_model) - self.assertEqual(200, resp.status) - - resp, model = self.baymodel_client.get_baymodel(new_model.uuid) - self.assertEqual(200, resp.status) - self.assertEqual(baymodel.uuid, new_model.uuid) - self.assertEqual(model.flavor_id, new_model.flavor_id) - gen_model = datagen.valid_bay_data(baymodel_id=baymodel.uuid) + gen_model.flavor_id = 'aaa' self.assertRaises( exceptions.BadRequest, self.bay_client.post_bay, gen_model)