From 34b0cadb727f0333fe6cde2edcbaf54da99f7024 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 10 Nov 2024 22:46:47 +0100 Subject: [PATCH] nixosTests.postgresql: test hardening gets relaxed The plv8 plugin requires access to pkey syscalls. The execution will crash hard when it is not allowed by the syscall filter. Co-Authored-By: Jan Tojnar --- nixos/tests/postgresql/postgresql.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nixos/tests/postgresql/postgresql.nix b/nixos/tests/postgresql/postgresql.nix index 509a14411de9c..803c16e7819f3 100644 --- a/nixos/tests/postgresql/postgresql.nix +++ b/nixos/tests/postgresql/postgresql.nix @@ -26,6 +26,15 @@ let INSERT INTO sth (id) VALUES (1); CREATE TABLE xmltest ( doc xml ); INSERT INTO xmltest (doc) VALUES ('ok'); -- check if libxml2 enabled + -- check if hardening gets relaxed + CREATE EXTENSION plv8; + DO $$ + let xs = []; + for (let i = 0, n = 4000000000; i < n; i++) { + xs.push(Math.round(Math.random() * n)) + } + console.log(Math.sum(xs)); + $$ LANGUAGE plv8; ''; makeTestForWithBackupAll = @@ -42,6 +51,7 @@ let services.postgresql = { inherit (package) ; enable = true; + extraPlugins = ps: with ps; [ plv8 ]; }; services.postgresqlBackup = {