mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-17 14:18:53 +00:00
nixosTests.dashy: use systemd-nspawn instead of qemu
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
|
||||
customSettings = {
|
||||
pageInfo = {
|
||||
title = "My Custom Dashy Title";
|
||||
@@ -45,29 +44,29 @@ in
|
||||
}
|
||||
];
|
||||
};
|
||||
nodes = {
|
||||
machine = { };
|
||||
containers = {
|
||||
container = { };
|
||||
|
||||
machine-custom = {
|
||||
custom = {
|
||||
services.dashy.settings = customSettings;
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
machine.wait_for_unit("nginx.service")
|
||||
machine.wait_for_open_port(80)
|
||||
container.wait_for_unit("nginx.service")
|
||||
container.wait_for_open_port(80)
|
||||
|
||||
actual = machine.succeed("curl -v --stderr - http://dashy.local/", timeout=10)
|
||||
actual = container.succeed("curl -v --stderr - http://dashy.local/", timeout=10)
|
||||
expected = "<title>Dashy</title>"
|
||||
assert expected in actual, \
|
||||
f"unexpected reply from Dashy, expected: '{expected}' got: '{actual}'"
|
||||
|
||||
machine_custom.wait_for_unit("nginx.service")
|
||||
machine_custom.wait_for_open_port(80)
|
||||
custom.wait_for_unit("nginx.service")
|
||||
custom.wait_for_open_port(80)
|
||||
|
||||
actual_custom = machine_custom.succeed("curl -s --stderr - http://dashy.local/conf.yml", timeout=10).strip()
|
||||
expected_custom = machine_custom.succeed("cat ${customSettingsYaml}").strip()
|
||||
actual_custom = custom.succeed("curl -s --stderr - http://dashy.local/conf.yml", timeout=10).strip()
|
||||
expected_custom = custom.succeed("cat ${customSettingsYaml}").strip()
|
||||
|
||||
assert expected_custom == actual_custom, \
|
||||
f"unexpected reply from Dashy, expected: '{expected_custom}' got: '{actual_custom}'"
|
||||
|
||||
Reference in New Issue
Block a user