nixos/tests/echoip: init
This commit is contained in:
parent
6a6d7de921
commit
96dd35f07d
@ -294,6 +294,7 @@ in {
|
||||
early-mount-options = handleTest ./early-mount-options.nix {};
|
||||
ec2-config = (handleTestOn ["x86_64-linux"] ./ec2.nix {}).boot-ec2-config or {};
|
||||
ec2-nixops = (handleTestOn ["x86_64-linux"] ./ec2.nix {}).boot-ec2-nixops or {};
|
||||
echoip = handleTest ./echoip.nix {};
|
||||
ecryptfs = handleTest ./ecryptfs.nix {};
|
||||
fscrypt = handleTest ./fscrypt.nix {};
|
||||
fastnetmon-advanced = runTest ./fastnetmon-advanced.nix;
|
||||
|
||||
29
nixos/tests/echoip.nix
Normal file
29
nixos/tests/echoip.nix
Normal file
@ -0,0 +1,29 @@
|
||||
import ./make-test-python.nix (
|
||||
{ lib, ... }:
|
||||
{
|
||||
name = "echoip";
|
||||
meta.maintainers = with lib.maintainers; [ defelo ];
|
||||
|
||||
nodes.machine = {
|
||||
services.echoip = {
|
||||
enable = true;
|
||||
virtualHost = "echoip.local";
|
||||
};
|
||||
|
||||
networking.hosts = {
|
||||
"127.0.0.1" = [ "echoip.local" ];
|
||||
"::1" = [ "echoip.local" ];
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
machine.wait_for_unit("echoip.service")
|
||||
machine.wait_for_open_port(8080)
|
||||
|
||||
resp = machine.succeed("curl -4 http://echoip.local/ip")
|
||||
assert resp.strip() == "127.0.0.1"
|
||||
resp = machine.succeed("curl -6 http://echoip.local/ip")
|
||||
assert resp.strip() == "::1"
|
||||
'';
|
||||
}
|
||||
)
|
||||
@ -3,6 +3,7 @@
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
makeWrapper,
|
||||
nixosTests,
|
||||
}:
|
||||
|
||||
buildGoModule {
|
||||
@ -26,6 +27,10 @@ buildGoModule {
|
||||
--add-flags "-t $out/share/echoip/html"
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tests = { inherit (nixosTests) echoip; };
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "IP address lookup service";
|
||||
homepage = "https://github.com/mpolden/echoip";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user