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

Fix tests for 3.1.7 #83

Merged
merged 11 commits into from
Jun 8, 2023
Prev Previous commit
Next Next commit
Comply tests generator and SQL schema to the new test.sql script
  • Loading branch information
ioguix committed Jun 8, 2023
commit d090b60976d56d533ddb3e64566e0635bfed59a1
8 changes: 1 addition & 7 deletions pgsodium_tapgen.pl
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,8 @@

################################################################################

print "BEGIN;\n",
"CREATE EXTENSION IF NOT EXISTS pgtap;\n",
"CREATE EXTENSION IF NOT EXISTS pgsodium;\n\n",
"SET search_path TO 'public';\n\n";
print "SET search_path TO 'public';\n";

print "SELECT plan(1); -- FIXME!\n";
print "\n\n\n---- POSTGRESQL MINIMAL VERSION\n";
print "SELECT cmp_ok("
."current_setting('server_version_num')::int, "
Expand Down Expand Up @@ -432,8 +428,6 @@
"]);\n";
}

print "\n\nROLLBACK;\n";

$dbh->rollback;

exit;
Expand Down
11 changes: 5 additions & 6 deletions test/pgsodium_schema.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
SET search_path TO 'public';



---- POSTGRESQL MINIMAL VERSION
SELECT cmp_ok(current_setting('server_version_num')::int, '>=', 130000, format('PostgreSQL version %s >= 13', current_setting('server_version')));

CREATE EXTENSION IF NOT EXISTS pgtap;
CREATE EXTENSION IF NOT EXISTS pgsodium;

SET search_path TO 'public';

---- EXTENSION VERSION
SELECT results_eq('SELECT pgsodium.version()', $$VALUES ('3.1.7'::text)$$, 'Version of pgsodium is 3.1.7');
Expand Down Expand Up @@ -453,7 +454,7 @@ WHERE rolname NOT IN ('pg_read_all_data','pg_write_all_data','pgsodium_keymaker'



---- Views
---- VIEWS

SELECT views_are('pgsodium', ARRAY[
'decrypted_key',
Expand Down Expand Up @@ -5780,5 +5781,3 @@ SELECT enums_are('pgsodium', ARRAY[

SELECT enum_has_labels('pgsodium','key_status', ARRAY['default','valid','invalid','expired']);
SELECT enum_has_labels('pgsodium','key_type', ARRAY['aead-ietf','aead-det','hmacsha512','hmacsha256','auth','shorthash','generichash','kdf','secretbox','secretstream','stream_xchacha20']);

SET search_path = pgsodium, public;