mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
nixos/tests: fix eval of several tests
The addition of the nspawn backend introduced a second argument passed to the attribute-set passed to `testScript`, i.e. containers[1]. Note: this is by no means intended to replace the compat fix from #501599, I believe we shouldn't have deprecated invocations in-tree at all, hence the change on this end. This is intended to only fix address the fallout from #478109, `nixosTests.parsedmarc` fails due to some postfix module changes to evaluate and the test of `peering-manasger` still seems broken. [1] https://github.com/NixOS/nixpkgs/pull/478109
This commit is contained in:
committed by
Jörg Thalheim
parent
6de7809357
commit
65bc98e452
@@ -165,7 +165,7 @@ in
|
||||
};
|
||||
|
||||
testScript =
|
||||
{ nodes }:
|
||||
{ nodes, ... }:
|
||||
let
|
||||
request = builtins.toJSON {
|
||||
title = "Private message";
|
||||
|
||||
@@ -54,38 +54,36 @@ in
|
||||
nodes.drbd1 = drbdConfig;
|
||||
nodes.drbd2 = drbdConfig;
|
||||
|
||||
testScript =
|
||||
{ nodes }:
|
||||
''
|
||||
drbd1.start()
|
||||
drbd2.start()
|
||||
testScript = ''
|
||||
drbd1.start()
|
||||
drbd2.start()
|
||||
|
||||
drbd1.wait_for_unit("network.target")
|
||||
drbd2.wait_for_unit("network.target")
|
||||
drbd1.wait_for_unit("network.target")
|
||||
drbd2.wait_for_unit("network.target")
|
||||
|
||||
drbd1.succeed(
|
||||
"drbdadm create-md r0",
|
||||
"drbdadm up r0",
|
||||
"drbdadm primary r0 --force",
|
||||
)
|
||||
drbd1.succeed(
|
||||
"drbdadm create-md r0",
|
||||
"drbdadm up r0",
|
||||
"drbdadm primary r0 --force",
|
||||
)
|
||||
|
||||
drbd2.succeed("drbdadm create-md r0", "drbdadm up r0")
|
||||
drbd2.succeed("drbdadm create-md r0", "drbdadm up r0")
|
||||
|
||||
drbd1.succeed(
|
||||
"mkfs.ext4 /dev/drbd0",
|
||||
"mkdir -p /mnt/drbd",
|
||||
"mount /dev/drbd0 /mnt/drbd",
|
||||
"touch /mnt/drbd/hello",
|
||||
"umount /mnt/drbd",
|
||||
"drbdadm secondary r0",
|
||||
)
|
||||
drbd1.sleep(1)
|
||||
drbd1.succeed(
|
||||
"mkfs.ext4 /dev/drbd0",
|
||||
"mkdir -p /mnt/drbd",
|
||||
"mount /dev/drbd0 /mnt/drbd",
|
||||
"touch /mnt/drbd/hello",
|
||||
"umount /mnt/drbd",
|
||||
"drbdadm secondary r0",
|
||||
)
|
||||
drbd1.sleep(1)
|
||||
|
||||
drbd2.succeed(
|
||||
"drbdadm primary r0",
|
||||
"mkdir -p /mnt/drbd",
|
||||
"mount /dev/drbd0 /mnt/drbd",
|
||||
"ls /mnt/drbd/hello",
|
||||
)
|
||||
'';
|
||||
drbd2.succeed(
|
||||
"drbdadm primary r0",
|
||||
"mkdir -p /mnt/drbd",
|
||||
"mount /dev/drbd0 /mnt/drbd",
|
||||
"ls /mnt/drbd/hello",
|
||||
)
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
};
|
||||
|
||||
testScript =
|
||||
{ nodes }:
|
||||
{ nodes, ... }:
|
||||
let
|
||||
aliceUid = toString nodes.machine.users.users.alice.uid;
|
||||
in
|
||||
|
||||
@@ -57,7 +57,7 @@ let
|
||||
};
|
||||
|
||||
testScript =
|
||||
{ nodes }:
|
||||
{ nodes, ... }:
|
||||
let
|
||||
deployerSetup = pkgs.writeScript "deployerSetup" ''
|
||||
#!${pkgs.runtimeShell}
|
||||
|
||||
@@ -91,7 +91,7 @@ in
|
||||
};
|
||||
|
||||
testScript =
|
||||
{ nodes }:
|
||||
{ nodes, ... }:
|
||||
let
|
||||
esPort = toString nodes.parsedmarc.config.services.elasticsearch.port;
|
||||
valueObject = lib.optionalString (lib.versionAtLeast nodes.parsedmarc.config.services.elasticsearch.package.version "7") ".value";
|
||||
@@ -202,7 +202,7 @@ in
|
||||
};
|
||||
|
||||
testScript =
|
||||
{ nodes }:
|
||||
{ nodes, ... }:
|
||||
let
|
||||
esPort = toString nodes.parsedmarc.config.services.elasticsearch.port;
|
||||
valueObject = lib.optionalString (lib.versionAtLeast nodes.parsedmarc.config.services.elasticsearch.package.version "7") ".value";
|
||||
|
||||
@@ -136,31 +136,29 @@ in
|
||||
|
||||
};
|
||||
|
||||
testScript =
|
||||
{ nodes }:
|
||||
''
|
||||
start_all()
|
||||
machine.wait_for_unit("maddy.service")
|
||||
machine.wait_for_open_port(143)
|
||||
machine.wait_for_open_port(993)
|
||||
machine.wait_for_open_port(587)
|
||||
machine.wait_for_open_port(465)
|
||||
testScript = ''
|
||||
start_all()
|
||||
machine.wait_for_unit("maddy.service")
|
||||
machine.wait_for_open_port(143)
|
||||
machine.wait_for_open_port(993)
|
||||
machine.wait_for_open_port(587)
|
||||
machine.wait_for_open_port(465)
|
||||
|
||||
# Send test mail to spam@domain
|
||||
machine.succeed("send-testmail")
|
||||
# Send test mail to spam@domain
|
||||
machine.succeed("send-testmail")
|
||||
|
||||
# Create mail directories required for rspamd-trainer and copy mail from
|
||||
# INBOX into INBOX/report_ham
|
||||
machine.succeed("create-mail-dirs")
|
||||
# Create mail directories required for rspamd-trainer and copy mail from
|
||||
# INBOX into INBOX/report_ham
|
||||
machine.succeed("create-mail-dirs")
|
||||
|
||||
# Start rspamd-trainer. It should read mail from INBOX/report_ham
|
||||
machine.wait_for_unit("rspamd.service")
|
||||
machine.wait_for_unit("redis-rspamd.service")
|
||||
machine.wait_for_file("/run/rspamd/rspamd.sock")
|
||||
machine.succeed("systemctl start rspamd-trainer.service")
|
||||
# Start rspamd-trainer. It should read mail from INBOX/report_ham
|
||||
machine.wait_for_unit("rspamd.service")
|
||||
machine.wait_for_unit("redis-rspamd.service")
|
||||
machine.wait_for_file("/run/rspamd/rspamd.sock")
|
||||
machine.succeed("systemctl start rspamd-trainer.service")
|
||||
|
||||
# Check if mail got processed by rspamd-trainer successfully and check for
|
||||
# it in INBOX/learned_ham
|
||||
machine.succeed("test-imap")
|
||||
'';
|
||||
# Check if mail got processed by rspamd-trainer successfully and check for
|
||||
# it in INBOX/learned_ham
|
||||
machine.succeed("test-imap")
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ in
|
||||
};
|
||||
|
||||
testScript =
|
||||
{ nodes }:
|
||||
{ nodes, ... }:
|
||||
let
|
||||
adminSocket = nodes.server.services.spire.server.settings.server.socket_path;
|
||||
workloadSocket = nodes.agent.services.spire.agent.settings.agent.socket_path;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
};
|
||||
|
||||
testScript =
|
||||
{ nodes }:
|
||||
{ nodes, ... }:
|
||||
''
|
||||
machine.start()
|
||||
machine.wait_for_unit("peering-manager.target")
|
||||
|
||||
@@ -44,7 +44,7 @@ in
|
||||
};
|
||||
|
||||
testScript =
|
||||
{ nodes }:
|
||||
{ nodes, ... }:
|
||||
let
|
||||
backupPath = "${nodes.snipeit.services.snipe-it.dataDir}/storage/app/backups";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user