diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2019-10-18 12:26:11 +0200 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2019-10-18 12:26:11 +0200 |
commit | c51c2f79b26b188c3bd47bcddfc82a525e8b785d (patch) | |
tree | 02f699abf18256223479b82c52d80c0a9a815110 /nixos/tests | |
parent | ddee2072598459877b3d34fc9f910dff494538b4 (diff) | |
parent | f702ae151685e0b29f73e71dfbf8fcdcb7d903b0 (diff) | |
download | nixlib-c51c2f79b26b188c3bd47bcddfc82a525e8b785d.tar nixlib-c51c2f79b26b188c3bd47bcddfc82a525e8b785d.tar.gz nixlib-c51c2f79b26b188c3bd47bcddfc82a525e8b785d.tar.bz2 nixlib-c51c2f79b26b188c3bd47bcddfc82a525e8b785d.tar.lz nixlib-c51c2f79b26b188c3bd47bcddfc82a525e8b785d.tar.xz nixlib-c51c2f79b26b188c3bd47bcddfc82a525e8b785d.tar.zst nixlib-c51c2f79b26b188c3bd47bcddfc82a525e8b785d.zip |
Merge master into staging-next
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/pppd.nix | 62 |
2 files changed, 63 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 914b32f97c3a..e94c9712cbfa 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -227,6 +227,7 @@ in postgresql = handleTest ./postgresql.nix {}; postgresql-wal-receiver = handleTest ./postgresql-wal-receiver.nix {}; powerdns = handleTest ./powerdns.nix {}; + pppd = handleTest ./pppd.nix {}; predictable-interface-names = handleTest ./predictable-interface-names.nix {}; printing = handleTest ./printing.nix {}; prometheus = handleTest ./prometheus.nix {}; diff --git a/nixos/tests/pppd.nix b/nixos/tests/pppd.nix new file mode 100644 index 000000000000..91f811859093 --- /dev/null +++ b/nixos/tests/pppd.nix @@ -0,0 +1,62 @@ +import ./make-test.nix ( + let + chap-secrets = { + text = ''"flynn" * "reindeerflotilla" *''; + mode = "0640"; + }; + in { + nodes = { + server = {config, pkgs, ...}: { + config = { + # Run a PPPoE access concentrator server. It will spawn an + # appropriate PPP server process when a PPPoE client sets up a + # PPPoE session. + systemd.services.pppoe-server = { + restartTriggers = [ + config.environment.etc."ppp/pppoe-server-options".source + config.environment.etc."ppp/chap-secrets".source + ]; + after = ["network.target"]; + serviceConfig = { + ExecStart = "${pkgs.rpPPPoE}/sbin/pppoe-server -F -O /etc/ppp/pppoe-server-options -q ${pkgs.ppp}/sbin/pppd -I eth1 -L 192.0.2.1 -R 192.0.2.2"; + }; + wantedBy = ["multi-user.target"]; + }; + environment.etc = { + "ppp/pppoe-server-options".text = '' + lcp-echo-interval 10 + lcp-echo-failure 2 + plugin rp-pppoe.so + require-chap + nobsdcomp + noccp + novj + ''; + "ppp/chap-secrets" = chap-secrets; + }; + }; + }; + client = {config, pkgs, ...}: { + services.pppd = { + enable = true; + peers.test = { + config = '' + plugin rp-pppoe.so eth1 + name "flynn" + noipdefault + persist + noauth + debug + ''; + }; + }; + environment.etc."ppp/chap-secrets" = chap-secrets; + }; + }; + + testScript = '' + startAll; + $client->waitUntilSucceeds("ping -c1 -W1 192.0.2.1"); + $server->waitUntilSucceeds("ping -c1 -W1 192.0.2.2"); + ''; + }) |