forked from lix-project/hydra
tests: allow specifying some nix config
This commit is contained in:
parent
c7ac123dc5
commit
e45f852277
1 changed files with 2 additions and 0 deletions
|
@ -19,6 +19,7 @@ our @EXPORT = qw(test_init hydra_setup nrBuildsForJobset queuedBuildsForJobset
|
||||||
# Hash Parameters:
|
# Hash Parameters:
|
||||||
#
|
#
|
||||||
# * hydra_config: configuration for the Hydra processes for your test.
|
# * hydra_config: configuration for the Hydra processes for your test.
|
||||||
|
# * nix_config: text to include in the test's nix.conf
|
||||||
#
|
#
|
||||||
# This clears several environment variables and sets them to ephemeral
|
# This clears several environment variables and sets them to ephemeral
|
||||||
# values: a temporary database, temporary Nix store, temporary Hydra
|
# values: a temporary database, temporary Nix store, temporary Hydra
|
||||||
|
@ -47,6 +48,7 @@ sub test_init {
|
||||||
my $nixconf = "$ENV{'NIX_CONF_DIR'}/nix.conf";
|
my $nixconf = "$ENV{'NIX_CONF_DIR'}/nix.conf";
|
||||||
open(my $fh, '>', $nixconf) or die "Could not open file '$nixconf' $!";
|
open(my $fh, '>', $nixconf) or die "Could not open file '$nixconf' $!";
|
||||||
print $fh "sandbox = false\n";
|
print $fh "sandbox = false\n";
|
||||||
|
print $fh $opts{'nix_config'} || "";
|
||||||
close $fh;
|
close $fh;
|
||||||
|
|
||||||
$ENV{'HYDRA_CONFIG'} = "$dir/hydra.conf";
|
$ENV{'HYDRA_CONFIG'} = "$dir/hydra.conf";
|
||||||
|
|
Loading…
Reference in a new issue