def setUp(self): self.root_directory = os.path.dirname(os.path.realpath(__file__)) self.failover_script_path = os.path.realpath( "{0}/../scripts/master_ip_hard_failover_helper".format(self.root_directory)) self.mha_helper_config_dir = os.path.join(self.root_directory, 'conf', 'good') if not self.mha_helper_config_dir: self.fail(msg='mha_helper configuration dir not set') ConfigHelper.MHA_HELPER_CONFIG_DIR = self.mha_helper_config_dir if not ConfigHelper.load_config(): self.fail(msg='Could not load mha_helper configuration from %s' % self.mha_helper_config_dir) self.orig_master_host = os.getenv('ORIG_MASTER_HOST') self.orig_master_ip = os.getenv('ORIG_MASTER_IP') self.orig_master_port = os.getenv('ORIG_MASTER_PORT') self.orig_master_user = os.getenv('ORIG_MASTER_USER') self.orig_master_password = os.getenv('ORIG_MASTER_PASSWORD') self.orig_master_ssh_host = os.getenv('ORIG_MASTER_SSH_HOST') self.orig_master_ssh_ip = os.getenv('ORIG_MASTER_SSH_IP') self.orig_master_ssh_port = os.getenv('ORIG_MASTER_SSH_PORT') self.orig_master_ssh_user = os.getenv('ORIG_MASTER_SSH_USER') self.new_master_host = os.getenv('NEW_MASTER_HOST') self.new_master_ip = os.getenv('NEW_MASTER_IP') self.new_master_port = os.getenv('NEW_MASTER_PORT') self.new_master_user = os.getenv('NEW_MASTER_USER') self.new_master_password = os.getenv('NEW_MASTER_PASSWORD') self.new_master_ssh_user = os.getenv('NEW_MASTER_SSH_USER') self.new_master_ssh_host = os.getenv('NEW_MASTER_SSH_HOST') self.new_master_ssh_ip = os.getenv('NEW_MASTER_SSH_IP') self.new_master_ssh_port = os.getenv('NEW_MASTER_SSH_PORT')
def setUp(self): self.root_directory = os.path.dirname(os.path.realpath(__file__)) mha_helper_config_dir = os.path.join(self.root_directory, 'conf', 'good') if not mha_helper_config_dir: self.fail(msg='mha_helper configuration dir not set') ConfigHelper.MHA_HELPER_CONFIG_DIR = mha_helper_config_dir if not ConfigHelper.load_config(): self.fail(msg='Could not load mha_helper configuration from %s' % mha_helper_config_dir) self.ssh_host = os.getenv('SSH_TEST_HOST') self.ssh_host_ip = os.getenv('SSH_TEST_IP') self.ssh_user = os.getenv('SSH_TEST_USER') self.ssh_port = os.getenv('SSH_TEST_PORT') if not self.ssh_host or not self.ssh_host_ip or not self.ssh_user or not self.ssh_port: self.fail(msg='SSH connection information not set') self.vip_helper = VIPMetalHelper(host=self.ssh_host, host_ip=self.ssh_host_ip, ssh_user=self.ssh_user, ssh_port=self.ssh_port, ssh_options=None)
def test_load_config_with_bad_config(self): # Test with bad config mha_helper_config_dir = os.path.join(self.root_directory, 'conf', 'bad') if not mha_helper_config_dir: self.fail(msg='mha_helper configuration dir not set') ConfigHelper.MHA_HELPER_CONFIG_DIR = mha_helper_config_dir self.assertFalse(ConfigHelper.load_config())
def test_load_config_with_bad_config(self): # Test with bad config mha_helper_config_dir = os.path.join(self.root_directory, 'conf', 'bad') if not mha_helper_config_dir: self.fail(msg='mha_helper configuration dir not set') ConfigHelper.MHA_HELPER_CONFIG_DIR = mha_helper_config_dir self.assertFalse(ConfigHelper.load_config())
def setUp(self): self.root_directory = os.path.dirname(os.path.realpath(__file__)) # Test with the correct config mha_helper_config_dir = os.path.join(self.root_directory, 'conf', 'good') if not mha_helper_config_dir: self.fail(msg='mha_helper configuration dir not set') ConfigHelper.MHA_HELPER_CONFIG_DIR = mha_helper_config_dir if not ConfigHelper.load_config(): self.fail(msg='Could not load mha_helper configuration from %s' % mha_helper_config_dir)
def setUp(self): self.root_directory = os.path.dirname(os.path.realpath(__file__)) # Test with the correct config mha_helper_config_dir = os.path.join(self.root_directory, 'conf', 'good') if not mha_helper_config_dir: self.fail(msg='mha_helper configuration dir not set') ConfigHelper.MHA_HELPER_CONFIG_DIR = mha_helper_config_dir if not ConfigHelper.load_config(): self.fail(msg='Could not load mha_helper configuration from %s' % mha_helper_config_dir)
def setUp(self): self.root_directory = os.path.dirname(os.path.realpath(__file__)) self.failover_report_script_path = os.path.realpath( "{0}/../scripts/master_failover_report".format(self.root_directory)) self.mha_helper_config_dir = os.path.join(self.root_directory, 'conf', 'good') if not self.mha_helper_config_dir: self.fail(msg='mha_helper configuration dir not set') ConfigHelper.MHA_HELPER_CONFIG_DIR = self.mha_helper_config_dir if not ConfigHelper.load_config(): self.fail(msg='Could not load mha_helper configuration from %s' % self.mha_helper_config_dir) self.orig_master_host = os.getenv('ORIG_MASTER_HOST') self.new_master_host = os.getenv('NEW_MASTER_HOST')
def setUp(self): self.root_directory = os.path.dirname(os.path.realpath(__file__)) self.failover_report_script_path = os.path.realpath( "{0}/../scripts/master_failover_report".format( self.root_directory)) self.mha_helper_config_dir = os.path.join(self.root_directory, 'conf', 'good') if not self.mha_helper_config_dir: self.fail(msg='mha_helper configuration dir not set') ConfigHelper.MHA_HELPER_CONFIG_DIR = self.mha_helper_config_dir if not ConfigHelper.load_config(): self.fail(msg='Could not load mha_helper configuration from %s' % self.mha_helper_config_dir) self.orig_master_host = os.getenv('ORIG_MASTER_HOST') self.new_master_host = os.getenv('NEW_MASTER_HOST')
def setUp(self): self.root_directory = os.path.dirname(os.path.realpath(__file__)) mha_helper_config_dir = os.path.join(self.root_directory, 'conf', 'good') if not mha_helper_config_dir: self.fail(msg='mha_helper configuration dir not set') ConfigHelper.MHA_HELPER_CONFIG_DIR = mha_helper_config_dir if not ConfigHelper.load_config(): self.fail(msg='Could not load mha_helper configuration from %s' % mha_helper_config_dir) self.ssh_host = os.getenv('SSH_TEST_HOST') self.ssh_host_ip = os.getenv('SSH_TEST_IP') self.ssh_user = os.getenv('SSH_TEST_USER') self.ssh_port = os.getenv('SSH_TEST_PORT') if not self.ssh_host or not self.ssh_host_ip or not self.ssh_user or not self.ssh_port: self.fail(msg='SSH connection information not set') self.vip_helper = VIPMetalHelper(host=self.ssh_host, host_ip=self.ssh_host_ip, ssh_user=self.ssh_user, ssh_port=self.ssh_port, ssh_options=None)