Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update postgresql94 -> 96 #3170

Merged
merged 2 commits into from
Jun 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
46 changes: 46 additions & 0 deletions tests/console/php5_postgresql96.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SUSE's openQA tests
#
# Copyright © 2016 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: PHP5 code that interacts locally with PostgreSQL
# This tests creates a PostgreSQL database and inserts an element.
# Then, PHP reads the elements and writes a new one in the database.
# If all succeed, the test passes.
#
# The test requires the Web and Scripting module on SLE
# Maintainer: Ondřej Súkup <osukup@suse.cz>


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

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

# ensure apache2 + php5 installed and running
setup_apache2(mode => 'PHP5');

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

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

# test itself
test_pgsql;

# destroy database
destroy_pgsqldb;
}
1;
47 changes: 47 additions & 0 deletions tests/console/php7_postgresql96.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# SUSE's openQA tests
#
# Copyright © 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: PHP7 code that interacts locally with PostgreSQL
# This tests creates a PostgreSQL database and inserts an element.
# Then, PHP reads the elements and writes a new one in the database.
# If all succeed, the test passes.
#
# The test requires the Web and Scripting module on SLE
# Maintainer: Ondřej Súkup <osukup@suse.cz>


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

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

# ensure apache2 + php7 installed and running
setup_apache2(mode => 'PHP7');

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

# start postgresql service
assert_script_run 'systemctl start postgresql';

# setup database
setup_pgsqldb;

# test itself
test_pgsql;

# destroy database
destroy_pgsqldb;
}
1;
30 changes: 0 additions & 30 deletions tests/console/postgresql94.pm

This file was deleted.

43 changes: 0 additions & 43 deletions tests/console/postgresql94server.pm

This file was deleted.

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: