Exemplo n.º 1
0
    def check(self):
        if linux.os["family"] in ("RedHat", "Oracle") and linux.os["version"] >= (6, 0):
            # Avoid "Can't locate Time/HiRes.pm in @INC"
            # with InnoDB Backup Utility v1.5.1-xtrabackup
            pkgmgr.installed("perl-Time-HiRes")

        mgr = pkgmgr.package_mgr()
        if not "percona" in mgr.repos():
            if linux.os["family"] in ("RedHat", "Oracle"):
                url = "http://www.percona.com/downloads/percona-release/percona-release-0.0-1.%s.rpm" % linux.os["arch"]
                pkgmgr.YumPackageMgr().localinstall(url)
            else:
                try:
                    codename = linux.os["lsb_codename"]
                except KeyError:
                    codename = linux.ubuntu_release_to_codename[linux.os["lsb_release"]]
                pkgmgr.apt_source(
                    "percona.list",
                    ["deb http://repo.percona.com/apt %s main" % codename],
                    gpg_keyserver="hkp://keys.gnupg.net",
                    gpg_keyid="CD2EFD2A",
                )
            mgr.updatedb()

        return super(PerconaExec, self).check()
Exemplo n.º 2
0
    def check(self):
        if linux.os['family'] in ('RedHat', 'Oracle') and linux.os['version'] >= (6, 0):
            # Avoid "Can't locate Time/HiRes.pm in @INC"
            # with InnoDB Backup Utility v1.5.1-xtrabackup
            pkgmgr.installed('perl-Time-HiRes')         

        mgr = pkgmgr.package_mgr()
        if not 'percona' in mgr.repos():
            if linux.os['family'] in ('RedHat', 'Oracle'):
                url = 'http://www.percona.com/downloads/percona-release/percona-release-0.0-1.%s.rpm' % linux.os['arch']
                pkgmgr.YumPackageMgr().localinstall(url)
            else:
                try:
                    codename = linux.os['lsb_codename']
                except KeyError:
                    codename = linux.ubuntu_release_to_codename[linux.os['lsb_release']]
                pkgmgr.apt_source(
                        'percona.list', 
                        ['deb http://repo.percona.com/apt %s main' % codename],
                        gpg_keyserver='hkp://keys.gnupg.net',
                        gpg_keyid='CD2EFD2A')
            mgr.updatedb()


        return super(PerconaExec, self).check()
Exemplo n.º 3
0
    def check(self):
        if linux.os['family'] in ('RedHat',
                                  'Oracle') and linux.os['version'] >= (6, 0):
            # Avoid "Can't locate Time/HiRes.pm in @INC"
            # with InnoDB Backup Utility v1.5.1-xtrabackup
            pkgmgr.installed('perl-Time-HiRes')

        mgr = pkgmgr.package_mgr()
        if not 'percona' in mgr.repos():
            if linux.os['family'] in ('RedHat', 'Oracle'):
                url = 'http://www.percona.com/downloads/percona-release/percona-release-0.0-1.%s.rpm' % linux.os[
                    'arch']
                pkgmgr.YumPackageMgr().localinstall(url)
                if linux.os.amazon:
                    linux.system(("sed -i 's/\$releasever/latest/g' "
                                  "/etc/yum.repos.d/Percona.repo"),
                                 shell=True)
            else:
                try:
                    codename = linux.os['lsb_codename']
                except KeyError:
                    codename = linux.ubuntu_release_to_codename[
                        linux.os['lsb_release']]
                pkgmgr.apt_source(
                    'percona.list',
                    ['deb http://repo.percona.com/apt %s main' % codename],
                    gpg_keyserver='hkp://keys.gnupg.net',
                    gpg_keyid='CD2EFD2A')
            mgr.updatedb()
        if software.mysql_software_info().version < (5, 5):
            self.package = 'percona-xtrabackup-21'
        else:
            self.package = 'percona-xtrabackup'

        return super(PerconaExec, self).check()
Exemplo n.º 4
0
    def check(self):
        if linux.os['family'] in ('RedHat', 'Oracle') and linux.os['version'] >= (6, 0):
            # Avoid "Can't locate Time/HiRes.pm in @INC"
            # with InnoDB Backup Utility v1.5.1-xtrabackup
            pkgmgr.installed('perl-Time-HiRes')         

        mgr = pkgmgr.package_mgr()
        if not 'percona' in mgr.repos():
            if linux.os['family'] in ('RedHat', 'Oracle'):
                url = 'http://www.percona.com/downloads/percona-release/percona-release-0.0-1.%s.rpm' % linux.os['arch']
                pkgmgr.YumPackageMgr().localinstall(url)
            else:
                try:
                    codename = linux.os['lsb_codename']
                except KeyError:
                    codename = linux.ubuntu_release_to_codename[linux.os['lsb_release']]
                pkgmgr.apt_source(
                        'percona.list', 
                        ['deb http://repo.percona.com/apt %s main' % codename],
                        gpg_keyserver='hkp://keys.gnupg.net',
                        gpg_keyid='CD2EFD2A')
            mgr.updatedb()


        return super(PerconaExec, self).check()
Exemplo n.º 5
0
    def check(self):
        if linux.os['family'] in ('RedHat', 'Oracle') and linux.os['version'] >= (6, 0):
            # Avoid "Can't locate Time/HiRes.pm in @INC"
            # with InnoDB Backup Utility v1.5.1-xtrabackup
            pkgmgr.installed('perl-Time-HiRes')         

        mgr = pkgmgr.package_mgr()
        if not 'percona' in mgr.repos():
            if linux.os['family'] in ('RedHat', 'Oracle'):
                url = 'http://www.percona.com/downloads/percona-release/percona-release-0.0-1.%s.rpm' % linux.os['arch']
                pkgmgr.YumPackageMgr().localinstall(url)
                if linux.os.amazon:
                    linux.system(("sed -i 's/\$releasever/latest/g' "
                                    "/etc/yum.repos.d/Percona.repo"), shell=True)
            else:
                try:
                    codename = linux.os['lsb_codename']
                except KeyError:
                    codename = linux.ubuntu_release_to_codename[linux.os['lsb_release']]
                pkgmgr.apt_source(
                        'percona.list', 
                        ['deb http://repo.percona.com/apt %s main' % codename],
                        gpg_keyserver='hkp://keys.gnupg.net',
                        gpg_keyid='CD2EFD2A')
            mgr.updatedb()
        if software.mysql_software_info().version < (5, 5):
            self.package = 'percona-xtrabackup-21'
        else:
            self.package = 'percona-xtrabackup'

        return super(PerconaExec, self).check()
Exemplo n.º 6
0
def test_apt_source(system, open):
    name = 'test_list'
    sources = ['deb http://test.repo/apt/${arch} ${codename1} ${codename12} main',
                       'deb-src http://test.repo/apt ${codename2} ${codename22} main']
    gpg_keyserver = 'key_server'
    gpg_keyid = 'key_id'
    file_contents = 'deb http://test.repo/apt/x86_64 c1 c12 main\ndeb-src http://test.repo/apt c2 c22 main'
    pkgmgr.apt_source(name, sources, gpg_keyserver, gpg_keyid)

    open.assert_called_once_with('/etc/apt/sources.list.d/'+name, 'w+')
    write_mock = open.return_value.__enter__().write
    write_mock.assert_called_once_with(file_contents)

    linux.system.assert_called_with(('apt-key', 'adv',
                                                                              '--keyserver', 'key_server',
                                                                              '--recv', 'key_id'),
                                                                             raise_exc=False)
Exemplo n.º 7
0
def test_apt_source(system, open):
    name = 'test_list'
    sources = ['deb http://test.repo/apt/${arch} ${codename1} ${codename12} main',
                       'deb-src http://test.repo/apt ${codename2} ${codename22} main']
    gpg_keyserver = 'key_server'
    gpg_keyid = 'key_id'
    file_contents = 'deb http://test.repo/apt/x86_64 c1 c12 main\ndeb-src http://test.repo/apt c2 c22 main'
    pkgmgr.apt_source(name, sources, gpg_keyserver, gpg_keyid)
 
    open.assert_called_once_with('/etc/apt/sources.list.d/'+name, 'w+')
    write_mock = open.return_value.__enter__().write
    write_mock.assert_called_once_with(file_contents)
 
    linux.system.assert_called_with(('apt-key', 'adv',
                                                                              '--keyserver', 'key_server',
                                                                              '--recv', 'key_id'),
                                                                             raise_exc=False)
Exemplo n.º 8
0
def test_apt_source(system, open):
    name = "test_list"
    sources = [
        "deb http://test.repo/apt/${arch} ${codename1} ${codename12} main",
        "deb-src http://test.repo/apt ${codename2} ${codename22} main",
    ]
    gpg_keyserver = "key_server"
    gpg_keyid = "key_id"
    file_contents = "deb http://test.repo/apt/x86_64 c1 c12 main\ndeb-src http://test.repo/apt c2 c22 main"
    pkgmgr.apt_source(name, sources, gpg_keyserver, gpg_keyid)

    open.assert_called_once_with("/etc/apt/sources.list.d/" + name, "w+")
    write_mock = open.return_value.__enter__().write
    write_mock.assert_called_once_with(file_contents)

    linux.system.assert_called_with(
        ("apt-key", "adv", "--keyserver", "key_server", "--recv", "key_id"), raise_exc=False
    )