Skip to content

Commit

Permalink
Update postgresql94 -> 96
Browse files Browse the repository at this point in the history
Verification run thanks to vsvecova:
http://dreamyhamster.suse.cz/tests/232#step/postgresql96server/1

Impact on openSUSE is not tested.

Related progress issue: https://progress.opensuse.org/issues/19976
  • Loading branch information
okurz committed Jun 28, 2017
1 parent 5aa4568 commit 0549eef
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 59 deletions.
6 changes: 3 additions & 3 deletions lib/apachetest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ sub setup_pgsqldb {
# 'could not change directory to "/root": Permission denied'
assert_script_run 'pushd /tmp';
assert_script_run "curl " . data_url('console/postgres_openqadb.sql') . " -o /tmp/postgres_openqadb.sql";
# requires running postgresql94 server
# test basic functionality - require postgresql94
# requires running postgresql server
# test basic functionality - require postgresql
assert_script_run "sudo -u postgres psql -f /tmp/postgres_openqadb.sql";
assert_script_run "sudo -u postgres psql -d openQAdb -c \"SELECT * FROM test\" | grep \"can you read this\"";

Expand Down Expand Up @@ -177,7 +177,7 @@ sub test_pgsql {
assert_script_run "systemctl restart postgresql.service";

# configure the PHP code that:
# 1. reads table 'test' from the 'openQAdb' database (created in 'console/postgresql94' test)
# 1. reads table 'test' from the 'openQAdb' database (created in 'console/postgresql...' test)
# 2. inserts a new element 'can php write this?' into the same table
type_string "curl " . data_url('console/test_postgresql_connector.php') . " -o /srv/www/htdocs/test_postgresql_connector.php\n";
assert_script_run "systemctl restart apache2.service";
Expand Down
4 changes: 2 additions & 2 deletions products/opensuse/main.pm
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,11 @@ sub load_consoletests() {
loadtest "console/dns_srv";
loadtest "console/php5";
loadtest "console/php5_mysql";
loadtest "console/php5_postgresql94";
loadtest "console/php5_postgresql96";
if (!is_staging()) {
loadtest "console/php7";
loadtest "console/php7_mysql";
loadtest "console/php7_postgresql94";
loadtest "console/php7_postgresql96";
}
}
if (check_var("DESKTOP", "xfce")) {
Expand Down
6 changes: 3 additions & 3 deletions products/sle/main.pm
Original file line number Diff line number Diff line change
Expand Up @@ -760,18 +760,18 @@ sub load_consoletests() {
loadtest "console/http_srv";
loadtest "console/mysql_srv";
loadtest "console/dns_srv";
loadtest "console/postgresql94server";
loadtest "console/postgresql96server";
if (sle_version_at_least('12-SP1')) { # shibboleth-sp not available on SLES 12 GA
loadtest "console/shibboleth";
}
if (get_var('ADDONS', '') =~ /wsm/ || get_var('SCC_ADDONS', '') =~ /wsm/) {
loadtest "console/pcre";
loadtest "console/php5";
loadtest "console/php5_mysql";
loadtest "console/php5_postgresql94";
loadtest "console/php5_postgresql96";
loadtest "console/php7";
loadtest "console/php7_mysql";
loadtest "console/php7_postgresql94";
loadtest "console/php7_postgresql96";
}
loadtest "console/apache_ssl";
loadtest "console/apache_nss";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ sub run() {
setup_apache2(mode => 'PHP5');

# install requirements
zypper_call "in php5-pgsql postgresql94-server sudo";
zypper_call 'in php5-pgsql postgresql96-server sudo';

# start postgresql
assert_script_run "systemctl start postgresql";
assert_script_run 'systemctl start postgresql';
# setup database
setup_pgsqldb;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ sub run() {
setup_apache2(mode => 'PHP7');

# install requirements
zypper_call "in php7-pgsql postgresql94-server sudo";
zypper_call 'in php7-pgsql postgresql96-server sudo';

# start postgresql service
assert_script_run "systemctl start postgresql";
assert_script_run 'systemctl start postgresql';

# setup database
setup_pgsqldb;
Expand Down
43 changes: 0 additions & 43 deletions tests/console/postgresql94server.pm

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ use utils;
sub run() {
select_console 'root-console';

# install the postgresql94 client package
zypper_call "in postgresql94";
# install the postgresql96 client package
zypper_call 'in postgresql96';

# check the postgresql94 client
assert_script_run "/usr/bin/psql --help", 200;
# check the postgresql client
assert_script_run '/usr/bin/psql --help', 200;
}

1;
Expand Down
38 changes: 38 additions & 0 deletions tests/console/postgresql96server.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SUSE's openQA tests
#
# Copyright © 2012-2017 SUSE LLC
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.

# Summary: Postgres tests for SLE12
# Maintainer: Ondřej Súkup <osukup@suse.cz>

use base "consoletest";
use strict;
use testapi;
use utils;
use apachetest;

sub run() {
select_console 'root-console';

# install the postgresql server package
zypper_call 'in postgresql96-server sudo';

# start the postgresql service
assert_script_run 'systemctl start postgresql.service', 200;

# check the status
assert_script_run 'systemctl show -p ActiveState postgresql.service | grep ActiveState=active';
assert_script_run 'systemctl show -p SubState postgresql.service | grep SubState=running';

# test basic functionality of postgresql
setup_pgsqldb;
destroy_pgsqldb;
}

1;
# vim: set sw=4 et:

0 comments on commit 0549eef

Please sign in to comment.