Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
122 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,46 @@ | ||
import ./make-test.nix ({ pkgs, ...} : { | ||
name = "postgresql"; | ||
meta = with pkgs.stdenv.lib.maintainers; { | ||
maintainers = [ zagy ]; | ||
}; | ||
|
||
nodes = { | ||
master = | ||
{ pkgs, config, ... }: | ||
{ system ? builtins.currentSystem }: | ||
with import ../lib/testing.nix { inherit system; }; | ||
with pkgs.lib; | ||
let | ||
postgresql-versions = pkgs.callPackages ../../pkgs/servers/sql/postgresql { }; | ||
test-sql = pkgs.writeText "postgresql-test" '' | ||
CREATE EXTENSION pgcrypto; -- just to check if lib loading works | ||
CREATE TABLE sth ( | ||
id int | ||
); | ||
INSERT INTO sth (id) VALUES (1); | ||
INSERT INTO sth (id) VALUES (1); | ||
INSERT INTO sth (id) VALUES (1); | ||
INSERT INTO sth (id) VALUES (1); | ||
INSERT INTO sth (id) VALUES (1); | ||
''; | ||
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; | ||
services.postgresql.initialScript = pkgs.writeText "postgresql-init.sql" | ||
'' | ||
CREATE ROLE postgres WITH superuser login createdb; | ||
''; | ||
}; | ||
}; | ||
|
||
testScript = '' | ||
startAll; | ||
$master->waitForUnit("postgresql"); | ||
$master->sleep(10); # Hopefully this is long enough!! | ||
$master->succeed("echo 'select 1' | sudo -u postgres psql"); | ||
''; | ||
}) | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
pkgs/development/compilers/gcc/6/darwin-const-correct.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 5972cd58bde3bc8bacfe994e5b127c411241f255 Mon Sep 17 00:00:00 2001 | ||
From: law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
Date: Tue, 3 Jan 2017 05:36:40 +0000 | ||
Subject: [PATCH] * config/darwin-driver.c (darwin_driver_init): | ||
Const-correctness fixes for first_period and second_period variables. | ||
|
||
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244010 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
--- | ||
diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c | ||
index 0c4f0cd..e3ed79d 100644 | ||
--- a/gcc/config/darwin-driver.c | ||
+++ b/gcc/config/darwin-driver.c | ||
@@ -299,10 +299,10 @@ darwin_driver_init (unsigned int *decoded_options_count, | ||
if (vers_string != NULL) | ||
{ | ||
char *asm_major = NULL; | ||
- char *first_period = strchr(vers_string, '.'); | ||
+ const char *first_period = strchr(vers_string, '.'); | ||
if (first_period != NULL) | ||
{ | ||
- char *second_period = strchr(first_period+1, '.'); | ||
+ const char *second_period = strchr(first_period+1, '.'); | ||
if (second_period != NULL) | ||
asm_major = xstrndup (vers_string, second_period-vers_string); | ||
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters