Exemple #1
0
    def test_run_sqlalchmey_operational_failure(self):
        class SQLAlchemyCommands(object):
            def operational_failure(self):
                raise sqlalchemy.exc.OperationalError("Can't open DB file")

        ret = cliutils.run(["rally", "failure", "operational_failure"],
                           {"failure": SQLAlchemyCommands})
        self.assertEqual(1, ret)
Exemple #2
0
    def test_run_failed_to_open_file(self, mock_api_check_db_revision):
        class FailuresCommands(object):
            def failed_to_open_file(self):
                raise IOError("No such file")

        ret = cliutils.run(["rally", "failure", "failed-to-open-file"],
                           {"failure": FailuresCommands})
        self.assertEqual(1, ret)
Exemple #3
0
    def test_run_failed_to_open_file(self):

        class FailuresCommands(object):

            def failed_to_open_file(self):
                raise IOError("No such file")

        ret = cliutils.run(["rally", "failure", "failed_to_open_file"],
                           {"failure": FailuresCommands})
        self.assertEqual(1, ret)
Exemple #4
0
    def test_run_sqlalchmey_operational_failure(self):

        class SQLAlchemyCommands(object):

            def operational_failure(self):
                raise sqlalchemy.exc.OperationalError("Can't open DB file")

        ret = cliutils.run(["rally", "failure", "operational_failure"],
                           {"failure": SQLAlchemyCommands})
        self.assertEqual(1, ret)
Exemple #5
0
 def test_run_show(self):
     ret = cliutils.run(["rally", "show", "keypairs"], self.categories)
     self.assertEqual(ret, 1)
Exemple #6
0
 def test_run_bash_completion(self):
     ret = cliutils.run(["rally", "bash-completion"], self.categories)
     self.assertEqual(ret, 0)
Exemple #7
0
 def test_run_bash_completion(self, mock_api_check_db_revision):
     ret = cliutils.run(["rally", "bash-completion"], self.categories)
     self.assertEqual(0, ret)
Exemple #8
0
def main():
    categories = {"db": DBCommands,
                  "tempest": TempestCommands}
    cliutils.run(sys.argv, categories)
Exemple #9
0
 def test_run_task_failed(self, mock_validate_args,
                          mock_api_check_db_revision):
     ret = cliutils.run(["rally", "task", "status",
                         "%s" % FAKE_TASK_UUID], self.categories)
     self.assertTrue(mock_validate_args.called)
     self.assertEqual(1, ret)
Exemple #10
0
 def test_run_bash_completion_with_query_category(self):
     ret = cliutils.run(["rally", "bash-completion", "info"],
                        self.categories)
     self.assertEqual(ret, 0)
Exemple #11
0
 def test_run_show_fails(self, mock_validate_args):
     ret = cliutils.run(["rally", "show", "keypairs"], self.categories)
     self.assertTrue(mock_validate_args.called)
     self.assertEqual(ret, 1)
Exemple #12
0
 def test_run_show(self):
     ret = cliutils.run(["rally", "show", "keypairs"], self.categories)
     self.assertEqual(ret, 1)
Exemple #13
0
 def test_run_bash_completion(self):
     ret = cliutils.run(["rally", "bash-completion"], self.categories)
     self.assertEqual(ret, 0)
Exemple #14
0
 def test_run_version(self):
     ret = cliutils.run(["rally", "version"], self.categories)
     self.assertEqual(ret, 0)
Exemple #15
0
 def test_run_fails(self, mock_cliutils_conf):
     ret = cliutils.run(["rally", "show", "flavors"], self.categories)
     self.assertEqual(ret, 2)
Exemple #16
0
 def test_run_bash_completion_with_query_category(self):
     ret = cliutils.run(["rally", "bash-completion", "info"],
                        self.categories)
     self.assertEqual(ret, 0)
Exemple #17
0
def main():
    categories = {"db": db.DBCommands}
    print("`rally-manage db <command>` was deprecated since 0.10.0 version "
          "and is going to be removed soon. Please use `rally db <command>`.")
    return cliutils.run(sys.argv, categories)
Exemple #18
0
 def test_run_task_not_found(self, mock_task_get):
     ret = cliutils.run(["rally", "task", "status", "%s" % FAKE_TASK_UUID],
                        self.categories)
     self.assertTrue(mock_task_get.called)
     self.assertEqual(ret, 1)
Exemple #19
0
 def test_run_show_fails(self, mock_validate_args):
     ret = cliutils.run(["rally", "show", "keypairs"], self.categories)
     self.assertTrue(mock_validate_args.called)
     self.assertEqual(ret, 1)
Exemple #20
0
def main():
    return cliutils.run(sys.argv, categories)
Exemple #21
0
 def test_run_bash_completion(self, mock_api_check_db_revision):
     ret = cliutils.run(["rally", "bash-completion"], self.categories)
     self.assertEqual(0, ret)
Exemple #22
0
 def test_run_task_failed(self, mock_validate_args,
                          mock_api_check_db_revision):
     ret = cliutils.run(["rally", "task", "status", "%s" % FAKE_TASK_UUID],
                        self.categories)
     self.assertTrue(mock_validate_args.called)
     self.assertEqual(1, ret)
Exemple #23
0
 def test_run_fails(self, mock_rally_api_api):
     ret = cliutils.run(["rally", "task list"], self.categories)
     self.assertEqual(2, ret)
     mock_rally_api_api.assert_called_once_with(config_args=["task list"],
                                                skip_db_check=True)
Exemple #24
0
def main():
    return cliutils.run(sys.argv, categories)
Exemple #25
0
 def test_run_task_not_found(self, mock_task_get,
                             mock_api_check_db_revision):
     ret = cliutils.run(["rally", "task", "status",
                         "%s" % FAKE_TASK_UUID], self.categories)
     self.assertTrue(mock_task_get.called)
     self.assertEqual(203, ret)
Exemple #26
0
 def test_run_version(self, mock_api_check_db_revision):
     ret = cliutils.run(["rally", "version"], self.categories)
     self.assertEqual(ret, 0)
Exemple #27
0
 def test_run_fails(self, mock_cliutils_conf):
     ret = cliutils.run(["rally", "show", "flavors"], self.categories)
     self.assertEqual(ret, 2)
Exemple #28
0
 def test_run_version(self):
     ret = cliutils.run(["rally", "version"], self.categories)
     self.assertEqual(ret, 0)
Exemple #29
0
def main():
    categories = {"db": DBCommands}
    return cliutils.run(sys.argv, categories)
Exemple #30
0
 def test_run_fails(self, mock_rally_api_api):
     ret = cliutils.run(["rally", "version"], self.categories)
     self.assertEqual(2, ret)
     mock_rally_api_api.assert_called_once_with(
         config_args=["version"], skip_db_check=True)