Example #1
0
 def integration_06d_execute_missing_recipe(self):
     actor = server_array.Execute('Execute missing::recipe', {
         'array': self.clone_name,
         'script': 'missing::recipe',
         'inputs': {}
     })
     with self.assertRaises(exceptions.RecoverableActorFailure):
         yield actor.execute()
Example #2
0
 def integration_06d_execute_missing_recipe_dry(self):
     actor = server_array.Execute('Execute missing::recipe', {
         'array': self.clone_name,
         'script': 'missing::recipe',
         'inputs': {}
     },
                                  dry=True)
     with self.assertRaises(exceptions.InvalidOptions):
         yield actor.execute()
Example #3
0
 def integration_06d_execute_incorrect_inputs(self):
     actor = server_array.Execute(
         'Execute %s' % self.clone_name, {
             'array': self.clone_name,
             'script': self.template_script,
             'inputs': {
                 'SLEEP': 'bogus field'
             }
         })
     with self.assertRaises(exceptions.RecoverableActorFailure):
         yield actor.execute()
Example #4
0
 def integration_06c_execute_missing_script_dry(self):
     actor = server_array.Execute('Execute %s' % self.clone_name, {
         'array': self.clone_name,
         'script': 'bogus script',
         'inputs': {
             'SLEEP': 'text:15'
         }
     },
                                  dry=True)
     with self.assertRaises(exceptions.InvalidOptions):
         yield actor.execute()
Example #5
0
 def integration_06b_execute(self):
     actor = server_array.Execute(
         'Execute %s' % self.clone_name, {
             'array': self.clone_name,
             'script': self.template_script,
             'inputs': {
                 'SLEEP': 'text:15'
             }
         })
     ret = yield actor.execute()
     self.assertEquals(ret, None)
Example #6
0
    def setUp(self, *args, **kwargs):
        super(TestExecuteActor, self).setUp()
        base.TOKEN = 'unittest'

        # Create the actor
        self.actor = server_array.Execute(
            'Execute',
            {'array': 'unittestarray',
             'script': 'test_script',
             'inputs': {'foo': 'text:bar'}})

        # Patch the actor so that we use the client mock
        self.client_mock = mock.MagicMock()
        self.actor._client = self.client_mock