mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
nixos/tests/wireguard: test for pre shared keys working with networkd
This commit is contained in:
parent
c1eb3b68f8
commit
61d11b7ea4
2 changed files with 12 additions and 0 deletions
|
@ -39,6 +39,9 @@ import ../make-test-python.nix (
|
|||
"fc00::2/128"
|
||||
];
|
||||
|
||||
# !!! Don't do this with real keys. The /nix store is world-readable!
|
||||
presharedKeyFile = toString (pkgs.writeText "presharedKey" wg-snakeoil-keys.presharedKey);
|
||||
|
||||
inherit (wg-snakeoil-keys.peer1) publicKey;
|
||||
};
|
||||
};
|
||||
|
@ -69,6 +72,9 @@ import ../make-test-python.nix (
|
|||
endpoint = "192.168.0.1:23542";
|
||||
persistentKeepalive = 25;
|
||||
|
||||
# !!! Don't do this with real keys. The /nix store is world-readable!
|
||||
presharedKeyFile = toString (pkgs.writeText "presharedKey" wg-snakeoil-keys.presharedKey);
|
||||
|
||||
inherit (wg-snakeoil-keys.peer0) publicKey;
|
||||
};
|
||||
};
|
||||
|
@ -87,6 +93,10 @@ import ../make-test-python.nix (
|
|||
|
||||
peer1.succeed("ping -c5 fc00::1")
|
||||
peer1.succeed("ping -c5 10.23.42.1")
|
||||
|
||||
with subtest("Has PSK set"):
|
||||
peer0.succeed("wg | grep 'preshared key'")
|
||||
peer1.succeed("wg | grep 'preshared key'")
|
||||
'';
|
||||
}
|
||||
)
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{
|
||||
presharedKey = "7myEJlGAWLTg83y7Py29pp7REQBVmZfI4xcawjcZpjg=";
|
||||
|
||||
peer0 = {
|
||||
privateKey = "OPuVRS2T0/AtHDp3PXkNuLQYDiqJaBEEnYe42BSnJnQ=";
|
||||
publicKey = "IujkG119YPr2cVQzJkSLYCdjpHIDjvr/qH1w1tdKswY=";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue