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_pemagent_packages(): host = get_pemserver() pg_version = get_pg_version() packages = [ 'edb-pem-agent', ] for package in packages: assert host.package(package).is_installed, \ "Package %s not installed" % packages
def test_setup_pemagent_service(): host = get_primary() pg_version = get_pg_version() service = 'pemagent' assert host.service(service).is_running, \ "Pemagent service not running" assert host.service(service).is_enabled, \ "Pemagent service not enabled"
def test_setup_pemserver_pg(): if get_pg_type() != 'PG': pytest.skip() host = get_pemserver() pg_version = get_pg_version() packages = [ 'edb-pem-server', 'sslutils_%s' % pg_version, 'postgresql%s-contrib' % pg_version, ] for package in packages: assert host.package(package).is_installed, \ "Package %s not installed" % packages
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