def test_install_dbserver_pg_centos(): if not get_os().startswith('centos') and not get_os().startswith('rocky'): pytest.skip() if get_pg_type() != 'PG': pytest.skip() host = get_primary() pg_version = get_pg_version() packages = [ 'glibc-common', 'ca-certificates', 'postgresql%s' % pg_version, 'postgresql%s-server' % pg_version, 'postgresql%s-contrib' % pg_version, 'sslutils_%s' % pg_version, ] if get_os() == 'centos7': packages += [ 'python-pycurl', 'libselinux-python', 'python-psycopg2', 'python-ipaddress' ] elif get_os() == 'rocky8': packages += [ 'python3-pycurl', 'python3-libselinux', 'python3-psycopg2' ] for package in packages: assert host.package(package).is_installed, \ "Package %s not installed" % packages
def test_setup_efm_debian(): if not (get_os().startswith('debian') or get_os().startswith('ubuntu')): pytest.skip() host = get_primary() packages = ['openjdk-8-jdk', 'bsd-mailx', 'edb-efm44'] for package in packages: assert host.package(package).is_installed, \ "Package %s not installed" % packages
def test_setup_efm_redhat(): if not get_os().startswith('centos') and not get_os().startswith('rocky'): pytest.skip() host = get_primary() packages = ['java-1.8.0-openjdk', 'mailx', 'edb-efm44'] for package in packages: assert host.package(package).is_installed, \ "Package %s not installed" % packages
def test_setup_repo_pgdg_debian(): if not (get_os().startswith('debian') or get_os().startswith('ubuntu')): pytest.skip() if get_pg_type() != 'PG': pytest.skip() host = get_primary() cmd = host.run("grep -rhE ^deb /etc/apt/sources.list*") assert cmd.succeeded, \ "Unable to list the package repository list" assert "apt.postgresql.org" in cmd.stdout, \ "Access to the PGDG package repository not configured"
def test_setup_repo_edb_debian(): if not EDB_ENABLE_REPO: pytest.skip() if not (get_os().startswith('debian') or get_os().startswith('ubuntu')): pytest.skip() host = get_primary() cmd = host.run("grep -rhE ^deb /etc/apt/sources.list*") assert cmd.succeeded, \ "Unable to list the package repository list" assert "apt.enterprisedb.com" in cmd.stdout, \ "Access to the EDB package repository not configured"
def test_setup_repo_pgdg_centos(): if not get_os().startswith('centos') and not get_os().startswith('rocky'): pytest.skip() if get_pg_type() != 'PG': pytest.skip() host = get_primary() cmd = host.run("yum repolist") assert cmd.succeeded, \ "Unable to list the package repository list on %s" % host assert "PostgreSQL common RPMs for RHEL / Rocky 8" in cmd.stdout, \ "Access to the PGDG package repository not configured"
def test_setup_repo_edb_centos(): if not EDB_ENABLE_REPO: pytest.skip() if not get_os().startswith('centos') and not get_os().startswith('rocky'): pytest.skip() host = get_primary() cmd = host.run("yum repolist") assert cmd.succeeded, \ "Unable to list the package repository list" assert "EnterpriseDB RPMs" in cmd.stdout, \ "Access to the EDB package repository not configured"
def test_install_dbserver_epas_centos(): if not get_os().startswith('centos') and not get_os().startswith('rocky'): pytest.skip() if get_pg_type() != 'EPAS': pytest.skip() host = get_primary() pg_version = int(get_pg_version()) packages = [ 'edb-as%s-server' % pg_version, 'edb-as%s-server-core' % pg_version, 'edb-as%s-server-contrib' % pg_version, 'edb-as%s-server-libs' % pg_version, 'edb-as%s-server-client' % pg_version, 'edb-as%s-server-sslutils' % pg_version, 'edb-as%s-server-indexadvisor' % pg_version, 'edb-as%s-server-sqlprofiler' % pg_version, 'edb-as%s-server-sqlprotect' % pg_version, 'edb-as%s-server-sslutils' % pg_version, ] if get_os() == 'centos7': packages += [ 'python2-pip', 'python-psycopg2', 'python-ipaddress', ] elif get_os() == 'rocky8': packages += [ 'python3-pip', 'python3-psycopg2', ] if pg_version > 10: packages += [ 'edb-as%s-server-llvmjit' % pg_version, ] if pg_version > 10 and pg_version < 14: packages += [ 'edb-as%s-server-edb-modules' % pg_version, ] elif pg_version >= 14: packages += [ 'edb-as%s-server-edb_wait_states' % pg_version, ] for package in packages: assert host.package(package).is_installed, \ "Package %s not installed" % packages
def test_init_dbserver_socket(): host = get_primary() if get_pg_type() == 'PG': sockets = ["tcp://5432", "unix:///var/run/postgresql/.s.PGSQL.5432"] elif get_pg_type() == 'EPAS': sockets = [ "tcp://5444", ] if get_os().startswith('centos') or get_os().startswith('rocky'): sockets.append("unix:///var/run/edb/as%s/.s.PGSQL.5444" % get_pg_version()) elif get_os().startswith('debian') or get_os().startswith('ubuntu'): sockets.append("unix:///var/run/edb-as/.s.PGSQL.5444") for socket in sockets: assert host.socket(socket).is_listening, \ "Postgres is not listening on %s" % socket
def test_init_dbserver_service(): host = get_primary() pg_version = get_pg_version() if get_os().startswith('centos') or get_os().startswith('rocky'): if get_pg_type() == 'PG': service = 'postgresql-%s' % pg_version elif get_pg_type() == 'EPAS': service = 'edb-as-%s' % pg_version elif get_os().startswith('debian') or get_os().startswith('ubuntu'): if get_pg_type() == 'PG': service = 'postgresql@%s-main' % pg_version elif get_pg_type() == 'EPAS': service = 'edb-as@%s-main' % pg_version assert host.service(service).is_running, \ "Postgres service not running" assert host.service(service).is_enabled, \ "Postgres service not enabled"
def test_install_dbserver_pg_debian(): if not (get_os().startswith('debian') or get_os().startswith('ubuntu')): pytest.skip() if get_pg_type() != 'PG': pytest.skip() host = get_primary() pg_version = get_pg_version() packages = [ 'ca-certificates', 'python3-pycurl', 'python3-psycopg2', 'postgresql-%s' % pg_version, 'postgresql-server-dev-%s' % pg_version, 'postgresql-%s-sslutils' % pg_version, ] if get_os() in ['debian9', 'debian10']: packages += ['python-psycopg2', 'python-ipaddress'] for package in packages: assert host.package(package).is_installed, \ "Package %s not installed" % packages
def test_install_dbserver_epas_debian(): if not (get_os().startswith('debian') or get_os().startswith('ubuntu')): pytest.skip() if get_pg_type() != 'EPAS': pytest.skip() host = get_primary() pg_version = int(get_pg_version()) packages = [ 'python3-pip', 'python3-psycopg2', 'edb-as%s-server' % pg_version, 'edb-as%s-server-core' % pg_version, 'edb-as%s-server-client' % pg_version, 'edb-as%s-server-sslutils' % pg_version, 'edb-as%s-server-indexadvisor' % pg_version, 'edb-as%s-server-sqlprofiler' % pg_version, 'edb-as%s-server-sqlprotect' % pg_version, 'edb-as%s-server-sslutils' % pg_version, ] if get_os() in ['debian9', 'debian10']: packages += [ 'python-psycopg2', 'python-ipaddress', ] if pg_version < 14: packages += [ 'edb-as%s-server-edb-modules' % pg_version, ] else: packages += [ 'edb-as%s-server-edb-wait-states' % pg_version, ] for package in packages: assert host.package(package).is_installed, \ "Package %s not installed" % packages