Beispiel #1
0
    def test_no_extra_file(self):

        """Function:  test_no_extra_file

        Description:  Test with no extra file present.

        Arguments:

        """

        self.assertEqual(mysql_libs.is_cfg_valid([self.slave2]),
                         (False, self.results))
Beispiel #2
0
    def test_cfg_valid(self, mock_chk):

        """Function:  test_cfg_valid

        Description:  Test with extra cfg file is valid.

        Arguments:

        """

        mock_chk.return_value = (True, None)

        self.assertEqual(mysql_libs.is_cfg_valid([self.slave1]), (True, []))
Beispiel #3
0
    def test_multi_both_fail(self, mock_chk):

        """Function:  test_multi_both_fail

        Description:  Test with multiple servers with both failed.

        Arguments:

        """

        mock_chk.return_value = (False, self.err_msg)

        self.assertEqual(mysql_libs.is_cfg_valid([self.slave1, self.slave2]),
                         (False, self.results2))
Beispiel #4
0
    def test_chk_fails(self, mock_chk):

        """Function:  test_chk_fails

        Description:  Test with check file fails.

        Arguments:

        """

        mock_chk.return_value = (False, self.err_msg)

        self.assertEqual(mysql_libs.is_cfg_valid([self.slave1]),
                         (False, self.err_msg2))
Beispiel #5
0
    def test_multi_servers(self, mock_chk):

        """Function:  test_multi_servers

        Description:  Test with multiple servers valid.

        Arguments:

        """

        mock_chk.return_value = (True, None)

        self.assertEqual(mysql_libs.is_cfg_valid([self.slave1, self.slave1]),
                         (True, []))
Beispiel #6
0
    def test_multi_one_fail(self, mock_chk):

        """Function:  test_multi_one_fail

        Description:  Test with multiple servers with one failed.

        Arguments:

        """

        mock_chk.return_value = (True, None)

        self.assertEqual(mysql_libs.is_cfg_valid([self.slave1, self.slave2]),
                         (False, self.results))