def test_cmd_args(self):
        """Test Cmd and Args."""
        rc = 1
        try:
            argv = [ 'test', 'param1' ]
            Cmd.get_command(sys.modules[__name__], 'test', argv)

        except Exception:
            rc = 0

        self.assertEqual(rc, 0)
示例#2
0
    def test_cluster_upgrade(self):
        """Test Cluster Upgrade."""
        rc = 0
        try:
            argv = ['cluster', 'upgrade', '-c', cortx_conf_url]

            cmd = Cmd.get_command(sys.modules['cortx.setup.cortx_setup'],
                                  'test_setup', argv)
            self.assertEqual(cmd.process(), 0)

        except Exception as e:
            print('Exception: ', e)
            sys.stderr.write("%s\n" % traceback.format_exc())
            rc = 1
        self.assertEqual(rc, 0)
示例#3
0
def main():
    CortxProvisionerLog.initialize(const.SERVICE_NAME, const.TMP_LOG_PATH)
    try:
        # Parse and Process Arguments
        command = Cmd.get_command(sys.modules[__name__], 'cortx_setup', \
            sys.argv[1:])
        rc = command.process()

    except CortxProvisionerError as e:
        Log.error('%s' % str(e))
        Log.error('%s' % traceback.format_exc())
        rc = e.rc

    except Exception as e:
        Log.error('%s' % str(e))
        Log.error('%s' % traceback.format_exc())
        rc = errno.EINVAL

    return rc
示例#4
0
    def test_001_config_apply(self):
        """Test Config Apply"""
        rc = 0
        try:
            for solution_conf_url in [
                    solution_cluster_url, solution_config_url
            ]:
                argv = [
                    'config', 'apply', '-f', solution_conf_url, '-c',
                    cortx_conf_url, '-o'
                ]
                cmd = Cmd.get_command(sys.modules['cortx.setup.cortx_setup'],
                                      'test_setup', argv)
                self.assertEqual(cmd.process(), 0)

        except Exception as e:
            print('Exception: ', e)
            sys.stderr.write("%s\n" % traceback.format_exc())
            rc = 1
        self.assertEqual(rc, 0)
示例#5
0
 def test_cmd_args(self):
     """Test Cmd and Args."""
     argv = ['test', 'param1']
     cmd = Cmd.get_command(sys.modules[__name__], 'test', argv)
     self.assertEqual(cmd.process(), 0)