mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
nixos/tests: systemd-resolved in stage 1
This commit is contained in:
parent
072054ccb5
commit
bfdba4d081
@ -41,6 +41,14 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
|
||||
networking.useNetworkd = true;
|
||||
networking.useDHCP = false;
|
||||
systemd.network.networks."40-eth0".enable = false;
|
||||
|
||||
testing.initrdBackdoor = true;
|
||||
boot.initrd = {
|
||||
systemd.enable = true;
|
||||
systemd.initrdBin = [ pkgs.iputils ];
|
||||
network.enable = true;
|
||||
services.resolved.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
testScript = { nodes, ... }: let
|
||||
@ -49,12 +57,19 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
|
||||
in ''
|
||||
start_all()
|
||||
server.wait_for_unit("multi-user.target")
|
||||
client.wait_for_unit("multi-user.target")
|
||||
|
||||
def test_client():
|
||||
query = client.succeed("resolvectl query example.com")
|
||||
assert "${address4}" in query
|
||||
assert "${address6}" in query
|
||||
client.succeed("ping -4 -c 1 example.com")
|
||||
client.succeed("ping -6 -c 1 example.com")
|
||||
|
||||
client.wait_for_unit("initrd.target")
|
||||
test_client()
|
||||
client.switch_root()
|
||||
|
||||
client.wait_for_unit("multi-user.target")
|
||||
test_client()
|
||||
'';
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user