nixos/tests/fakeroute: init
This commit is contained in:
parent
7d263715bd
commit
623d7d2124
3 changed files with 26 additions and 1 deletions
|
@ -253,6 +253,7 @@ in {
|
||||||
etebase-server = handleTest ./etebase-server.nix {};
|
etebase-server = handleTest ./etebase-server.nix {};
|
||||||
etesync-dav = handleTest ./etesync-dav.nix {};
|
etesync-dav = handleTest ./etesync-dav.nix {};
|
||||||
evcc = handleTest ./evcc.nix {};
|
evcc = handleTest ./evcc.nix {};
|
||||||
|
fakeroute = handleTest ./fakeroute.nix {};
|
||||||
fancontrol = handleTest ./fancontrol.nix {};
|
fancontrol = handleTest ./fancontrol.nix {};
|
||||||
fcitx5 = handleTest ./fcitx5 {};
|
fcitx5 = handleTest ./fcitx5 {};
|
||||||
fenics = handleTest ./fenics.nix {};
|
fenics = handleTest ./fenics.nix {};
|
||||||
|
|
22
nixos/tests/fakeroute.nix
Normal file
22
nixos/tests/fakeroute.nix
Normal 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")
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, stdenv, fetchurl }:
|
{ lib, stdenv, fetchurl, nixosTests }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "fakeroute";
|
pname = "fakeroute";
|
||||||
|
@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
|
||||||
hash = "sha256-DoXGJm8vOlAD6ZuvVAt6bkgfahc8WgyYIXCrgqzfiWg=";
|
hash = "sha256-DoXGJm8vOlAD6ZuvVAt6bkgfahc8WgyYIXCrgqzfiWg=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
passthru.tests.fakeroute = nixosTests.fakeroute;
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = ''
|
description = ''
|
||||||
Make your machine appears to be anywhere on the internet in a traceroute
|
Make your machine appears to be anywhere on the internet in a traceroute
|
||||||
|
|
Loading…
Reference in a new issue