Example #1
0
 def integration_03b_update_dry_missing_array(self):
     actor = server_array.Update('Update missing array', {
         'array': 'unit-test-fake-array',
         'params': {},
         'inputs': {}
     },
                                 dry=True)
     ret = yield actor.execute()
     self.assertEquals(ret, None)
Example #2
0
 def integration_04b_update_inputs(self):
     # There is no way to validate that the actual inputs were set right,
     # nor can we expect the end user to have the exact same server template
     # inputs that we want here. We can still execute the code though and
     # make sure it doesnt error out.
     actor = server_array.Update('Update %s' % self.clone_name, {
         'array': self.clone_name,
         'inputs': {
             'TEST_INPUT': 'text:TEST_VALUE'
         }
     })
     ret = yield actor.execute()
     self.assertEquals(ret, None)
Example #3
0
    def setUp(self, *args, **kwargs):
        super(TestUpdateActor, self).setUp()
        base.TOKEN = 'unittest'

        # Create the actor
        self.actor = server_array.Update(
            'Patch',
            {'array': 'unittestarray',
                'params': {'name': 'newunitarray'},
                'inputs': {'test': 'text:test'}})

        # Patch the actor so that we use the client mock
        self.client_mock = mock.MagicMock()
        self.actor._client = self.client_mock
Example #4
0
 def integration_04c_update_with_invalid_params_422(self):
     actor = server_array.Update(
         'Update %s' % self.clone_name, {
             'array': self.clone_name,
             'params': {
                 'elasticity_params': {
                     'bounds': {
                         'min_count': '5',
                         'max_count': '1'
                     }
                 }
             }
         })
     with self.assertRaises(exceptions.RecoverableActorFailure):
         yield actor.execute()
Example #5
0
 def integration_04e_update_missing_array(self):
     # Patch the array with some new min_instance settings, then launch it
     actor = server_array.Update(
         'Update missing array', {
             'array': 'unit-test-fake-array',
             'params': {
                 'elasticity_params': {
                     'bounds': {
                         'min_count': '1',
                         'max_count': '1'
                     }
                 },
                 'status': 'enabled',
                 'description': 'Unit Tests: %s' % UUID
             }
         })
     with self.assertRaises(exceptions.RecoverableActorFailure):
         yield actor.execute()
Example #6
0
 def integration_04a_update_params(self):
     # Patch the array with some new min_instance settings, then launch it
     actor = server_array.Update(
         'Update %s' % self.clone_name, {
             'array': self.clone_name,
             'params': {
                 'elasticity_params': {
                     'bounds': {
                         'min_count': '1',
                         'max_count': '2'
                     }
                 },
                 'status': 'enabled',
                 'description': 'Unit Tests: %s' % UUID
             }
         })
     ret = yield actor.execute()
     self.assertEquals(ret, None)
Example #7
0
 def integration_04d_update_with_invalid_params_400(self):
     actor = server_array.Update(
         'Update %s' % self.clone_name,
         {
             'array': self.clone_name,
             'params': {
                 'elasticity_params': {
                     'schedule': [
                         # Note the 'time' field is missing the :
                         {
                             'day': 'Sunday',
                             'min_count': '1',
                             'max_count': '1',
                             'time': '0700'
                         }
                     ]
                 }
             }
         })
     with self.assertRaises(exceptions.RecoverableActorFailure):
         yield actor.execute()
Example #8
0
 def integration_03a_update_dry(self):
     actor = server_array.Update('Update %s' % self.clone_name,
                                 {'array': self.clone_name},
                                 dry=True)
     ret = yield actor.execute()
     self.assertEquals(ret, None)