Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
2dbb3c85d0
@ -21,6 +21,7 @@ let
|
|||||||
use-ipv6=${if ipv6 then "yes" else "no"}
|
use-ipv6=${if ipv6 then "yes" else "no"}
|
||||||
${optionalString (interfaces!=null) "allow-interfaces=${concatStringsSep "," interfaces}"}
|
${optionalString (interfaces!=null) "allow-interfaces=${concatStringsSep "," interfaces}"}
|
||||||
${optionalString (domainName!=null) "domain-name=${domainName}"}
|
${optionalString (domainName!=null) "domain-name=${domainName}"}
|
||||||
|
allow-point-to-point=${if allowPointToPoint then "yes" else "no"}
|
||||||
|
|
||||||
[wide-area]
|
[wide-area]
|
||||||
enable-wide-area=${if wideArea then "yes" else "no"}
|
enable-wide-area=${if wideArea then "yes" else "no"}
|
||||||
@ -98,6 +99,15 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
allowPointToPoint = mkOption {
|
||||||
|
default = false;
|
||||||
|
description= ''
|
||||||
|
Whether to use POINTTOPOINT interfaces. Might make mDNS unreliable due to usually large
|
||||||
|
latencies with such links and opens a potential security hole by allowing mDNS access from Internet
|
||||||
|
connections. Use with care and YMMV!
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
wideArea = mkOption {
|
wideArea = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
description = ''Whether to enable wide-area service discovery.'';
|
description = ''Whether to enable wide-area service discovery.'';
|
||||||
|
@ -288,8 +288,8 @@ in rec {
|
|||||||
tests.pam-oath-login = callTest tests/pam-oath-login.nix {};
|
tests.pam-oath-login = callTest tests/pam-oath-login.nix {};
|
||||||
#tests.panamax = hydraJob (import tests/panamax.nix { system = "x86_64-linux"; });
|
#tests.panamax = hydraJob (import tests/panamax.nix { system = "x86_64-linux"; });
|
||||||
tests.peerflix = callTest tests/peerflix.nix {};
|
tests.peerflix = callTest tests/peerflix.nix {};
|
||||||
|
tests.postgresql = callSubTests tests/postgresql.nix {};
|
||||||
tests.pgjwt = callTest tests/pgjwt.nix {};
|
tests.pgjwt = callTest tests/pgjwt.nix {};
|
||||||
tests.postgresql = callTest tests/postgresql.nix {};
|
|
||||||
tests.printing = callTest tests/printing.nix {};
|
tests.printing = callTest tests/printing.nix {};
|
||||||
tests.proxy = callTest tests/proxy.nix {};
|
tests.proxy = callTest tests/proxy.nix {};
|
||||||
tests.pumpio = callTest tests/pump.io.nix {};
|
tests.pumpio = callTest tests/pump.io.nix {};
|
||||||
|
@ -1,26 +1,46 @@
|
|||||||
import ./make-test.nix ({ pkgs, ...} : {
|
{ system ? builtins.currentSystem }:
|
||||||
name = "postgresql";
|
with import ../lib/testing.nix { inherit system; };
|
||||||
meta = with pkgs.stdenv.lib.maintainers; {
|
with pkgs.lib;
|
||||||
maintainers = [ zagy ];
|
let
|
||||||
};
|
postgresql-versions = pkgs.callPackages ../../pkgs/servers/sql/postgresql { };
|
||||||
|
test-sql = pkgs.writeText "postgresql-test" ''
|
||||||
nodes = {
|
CREATE EXTENSION pgcrypto; -- just to check if lib loading works
|
||||||
master =
|
CREATE TABLE sth (
|
||||||
{ pkgs, config, ... }:
|
id int
|
||||||
|
);
|
||||||
{
|
INSERT INTO sth (id) VALUES (1);
|
||||||
services.postgresql.enable = true;
|
INSERT INTO sth (id) VALUES (1);
|
||||||
services.postgresql.initialScript = pkgs.writeText "postgresql-init.sql"
|
INSERT INTO sth (id) VALUES (1);
|
||||||
''
|
INSERT INTO sth (id) VALUES (1);
|
||||||
CREATE ROLE postgres WITH superuser login createdb;
|
INSERT INTO sth (id) VALUES (1);
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
testScript = ''
|
|
||||||
startAll;
|
|
||||||
$master->waitForUnit("postgresql");
|
|
||||||
$master->sleep(10); # Hopefully this is long enough!!
|
|
||||||
$master->succeed("echo 'select 1' | sudo -u postgres psql");
|
|
||||||
'';
|
'';
|
||||||
})
|
make-postgresql-test = postgresql-name: postgresql-package: {
|
||||||
|
name = postgresql-name;
|
||||||
|
meta = with pkgs.stdenv.lib.maintainers; {
|
||||||
|
maintainers = [ zagy ];
|
||||||
|
};
|
||||||
|
|
||||||
|
machine = {pkgs, config, ...}:
|
||||||
|
{
|
||||||
|
services.postgresql.package=postgresql-package;
|
||||||
|
services.postgresql.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
$machine->start;
|
||||||
|
$machine->waitForUnit("postgresql");
|
||||||
|
# postgresql should be available just after unit start
|
||||||
|
$machine->succeed("cat ${test-sql} | psql postgres");
|
||||||
|
$machine->shutdown; # make sure that postgresql survive restart (bug #1735)
|
||||||
|
sleep(2);
|
||||||
|
$machine->start;
|
||||||
|
$machine->waitForUnit("postgresql");
|
||||||
|
$machine->fail('test $(psql postgres -tAc "SELECT * FROM sth;"|wc -l) -eq 3');
|
||||||
|
$machine->succeed('test $(psql postgres -tAc "SELECT * FROM sth;"|wc -l) -eq 5');
|
||||||
|
$machine->fail('test $(psql postgres -tAc "SELECT * FROM sth;"|wc -l) -eq 4');
|
||||||
|
$machine->shutdown;
|
||||||
|
'';
|
||||||
|
|
||||||
|
};
|
||||||
|
in
|
||||||
|
mapAttrs' (p-name: p-package: {name=p-name; value=make-postgresql-test p-name p-package;}) postgresql-versions
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
{ stdenv, fetchurl, unzip, jre }:
|
{ stdenv, fetchurl, unzip, jre }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "0.6.7";
|
version = "0.6.8";
|
||||||
baseName = "scalafmt";
|
baseName = "scalafmt";
|
||||||
name = "${baseName}-${version}";
|
name = "${baseName}-${version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://github.com/scalameta/scalafmt/releases/download/v${version}/${baseName}.tar.gz";
|
url = "https://github.com/scalameta/scalafmt/releases/download/v${version}/${baseName}.tar.gz";
|
||||||
sha256 = "122x4a5x8024s7qqqs7vx8kz1x18q2l6alcvpzvsqkc304ybhfmh";
|
sha256 = "1iaanrxk5lhxx1zj9gbxzgqbnyy1azfrab984mga7di5z1hs02s2";
|
||||||
};
|
};
|
||||||
|
|
||||||
unpackPhase = "tar xvzf $src";
|
unpackPhase = "tar xvzf $src";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user