def test_nodetool_command_with_ssl_false(self):
     config = configparser.ConfigParser(interpolation=None)
     config['cassandra'] = {
         'nodetool_ssl': 'false',
         'nodetool_username': '******',
         'nodetool_password': '******',
         'nodetool_password_file_path': '/etc/cassandra/jmx.password',
         'nodetool_host': '127.0.0.1',
         'nodetool_port': '7199'
     }
     config["grpc"] = {"enabled": "0"}
     config['kubernetes'] = {"enabled": "0"}
     medusa_config = MedusaConfig(
         storage=None,
         monitoring=None,
         cassandra=_namedtuple_from_dict(CassandraConfig,
                                         config['cassandra']),
         ssh=None,
         checks=None,
         logging=None,
         grpc=_namedtuple_from_dict(GrpcConfig, config['grpc']),
         kubernetes=_namedtuple_from_dict(KubernetesConfig,
                                          config['kubernetes']),
     )
     n = Nodetool(medusa_config.cassandra).nodetool
     expected = [
         'nodetool', '-u', 'cassandra', '-pw', 'password', '-pwf',
         '/etc/cassandra/jmx.password', '-h', '127.0.0.1', '-p', '7199'
     ]
     self.assertEqual(n, expected)
示例#2
0
 def test_nodetool_command_without_parameter(self):
     config = configparser.ConfigParser(interpolation=None)
     config['cassandra'] = {}
     medusa_config = MedusaConfig(storage=None,
                                  monitoring=None,
                                  cassandra=_namedtuple_from_dict(
                                      CassandraConfig, config['cassandra']),
                                  ssh=None,
                                  restore=None,
                                  logging=None)
     n = Nodetool(medusa_config.cassandra).nodetool
     self.assertEqual(n, ['nodetool'])
 def test_nodetool_command_without_parameter(self):
     config = configparser.ConfigParser(interpolation=None)
     config['cassandra'] = {}
     config["grpc"] = {"enabled": "0"}
     config['kubernetes'] = {"enabled": "0"}
     medusa_config = MedusaConfig(
         storage=None,
         monitoring=None,
         cassandra=_namedtuple_from_dict(CassandraConfig,
                                         config['cassandra']),
         ssh=None,
         checks=None,
         logging=None,
         grpc=_namedtuple_from_dict(GrpcConfig, config['grpc']),
         kubernetes=_namedtuple_from_dict(KubernetesConfig,
                                          config['kubernetes']),
     )
     n = Nodetool(medusa_config.cassandra).nodetool
     self.assertEqual(n, ['nodetool'])
 def test_nodetool_command_with_parameters(self):
     config = configparser.ConfigParser(interpolation=None)
     config['cassandra'] = {
         'nodetool_ssl': 'true',
         'nodetool_username': '******',
         'nodetool_password': '******',
         'nodetool_password_file_path': '/etc/cassandra/jmx.password',
         'nodetool_host': '127.0.0.1',
         'nodetool_port': '7199'
     }
     medusa_config = MedusaConfig(
         storage=None,
         monitoring=None,
         cassandra=_namedtuple_from_dict(CassandraConfig, config['cassandra']),
         ssh=None,
         checks=None,
         logging=None
     )
     n = Nodetool(medusa_config.cassandra).nodetool
     expected = ['nodetool', '--ssl', '-u', 'cassandra', '-pw', 'password', '-pwf', '/etc/cassandra/jmx.password',
                 '-h', '127.0.0.1', '-p', '7199']
     self.assertEqual(n, expected)