nixos/tests/fakeroute: init

This commit is contained in:
rnhmjoj 2023-06-18 02:59:06 +02:00 committed by Anderson Torres
parent 7d263715bd
commit 623d7d2124
3 changed files with 26 additions and 1 deletions

View File

@ -253,6 +253,7 @@ in {
etebase-server = handleTest ./etebase-server.nix {};
etesync-dav = handleTest ./etesync-dav.nix {};
evcc = handleTest ./evcc.nix {};
fakeroute = handleTest ./fakeroute.nix {};
fancontrol = handleTest ./fancontrol.nix {};
fcitx5 = handleTest ./fcitx5 {};
fenics = handleTest ./fenics.nix {};

22
nixos/tests/fakeroute.nix Normal file
View File

@ -0,0 +1,22 @@
import ./make-test-python.nix ({ lib, pkgs, ...} : {
name = "fakeroute";
meta.maintainers = with lib.maintainers; [ rnhmjoj ];
nodes.machine = { ... }: {
imports = [ ../modules/profiles/minimal.nix ];
services.fakeroute.enable = true;
services.fakeroute.route =
[ "216.102.187.130" "4.0.1.122"
"198.116.142.34" "63.199.8.242"
];
environment.systemPackages = [ pkgs.traceroute ];
};
testScript =
''
start_all()
machine.wait_for_unit("fakeroute.service")
machine.succeed("traceroute 127.0.0.1 | grep -q 216.102.187.130")
'';
})

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl }:
{ lib, stdenv, fetchurl, nixosTests }:
stdenv.mkDerivation rec {
pname = "fakeroute";
@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
hash = "sha256-DoXGJm8vOlAD6ZuvVAt6bkgfahc8WgyYIXCrgqzfiWg=";
};
passthru.tests.fakeroute = nixosTests.fakeroute;
meta = with lib; {
description = ''
Make your machine appears to be anywhere on the internet in a traceroute