Example #1
0
 def __init__(self, cloudfs_source=None, prev_cloudfs_source=None, **kwds):
     backup.Restore.__init__(self,
                             cloudfs_source=cloudfs_source,
                             prev_cloudfs_source=prev_cloudfs_source,
                             **kwds)
     XtrabackupMixin.__init__(self)
     self._mysql_init = mysql_svc.MysqlInitScript()
Example #2
0
 def __init__(self, **kwds):
     super(MySQLSnapBackup, self).__init__(**kwds)
     self.on(
         freeze=self.freeze,
         unfreeze=self.unfreeze
     )
     self._mysql_init = mysql_svc.MysqlInitScript()
Example #3
0
    def test_get_mysql_error(self, mock_get_mysql_logerror_path):
        mock_get_mysql_logerror_path.return_value = '/tmp/test_error.log'
        content = "\n\
130518 15:29:39 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql\n\
121221 10:32:04 InnoDB: Fatal error: cannot allocate memory for the buffer pool\n\
121221 10:32:04 ERROR Plugin 'InnoDB' init function returned error.\n\
121221 10:32:04 ERROR Plugin 'InnoDB' registration as a STORAGE ENGINE failed.\n\
121221 10:32:04 ERROR Unknown/unsupported storage engine: InnoDB\n\
121221 10:32:04 ERROR Aborting\n\
130518 15:29:39 InnoDB: Mutexes and rw_locks use GCC atomic builtins\n"

        with open('/tmp/test_error.log', 'w') as f:
            f.write(content)

        right_content = "\
121221 10:32:04 InnoDB: Fatal error: cannot allocate memory for the buffer pool\n\
121221 10:32:04 ERROR Plugin 'InnoDB' init function returned error.\n\
121221 10:32:04 ERROR Plugin 'InnoDB' registration as a STORAGE ENGINE failed.\n\
121221 10:32:04 ERROR Unknown/unsupported storage engine: InnoDB\n\
121221 10:32:04 ERROR Aborting\n"

        obj = mysql_svc.MysqlInitScript()
        assert obj._get_mysql_error() == right_content

        os.remove('/tmp/test_error.log')
Example #4
0
def setup(feat):
    if feat.name == FEATURE:
        p = mock.patch.multiple(s3.S3FileSystem,
                        _bucket_location=mock.Mock(return_value=''),
                        _get_connection=mock.Mock(side_effect=lambda: boto.connect_s3()))
        p.start()
        world.s3_patcher = p
        world.mysql_init = mysql_svc.MysqlInitScript()
        linux.system('mysqladmin create xtrabackup', shell=True, raise_exc=False)
Example #5
0
 def __init__(self):
     self._mysql_init = mysql_svc.MysqlInitScript()
     self._op_api = operation.OperationAPI()
Example #6
0
 def __init__(self):
     self._mysql_init = mysql_svc.MysqlInitScript()