diff options
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/config/vpnc.nix | 41 | ||||
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/rename.nix | 1 | ||||
-rw-r--r-- | nixos/tests/gotify-server.nix | 44 | ||||
-rw-r--r-- | nixos/tests/xmpp/prosody-mysql.nix | 20 | ||||
-rw-r--r-- | nixos/tests/xmpp/prosody.nix | 20 |
6 files changed, 43 insertions, 84 deletions
diff --git a/nixos/modules/config/vpnc.nix b/nixos/modules/config/vpnc.nix deleted file mode 100644 index 356e007c0a3e..000000000000 --- a/nixos/modules/config/vpnc.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.networking.vpnc; - mkServiceDef = name: value: - { - name = "vpnc/${name}.conf"; - value = { text = value; }; - }; - -in -{ - options = { - networking.vpnc = { - services = mkOption { - type = types.attrsOf types.str; - default = {}; - example = literalExample '' - { test = ''' - IPSec gateway 192.168.1.1 - IPSec ID someID - IPSec secret secretKey - Xauth username name - Xauth password pass - '''; - } - ''; - description = - '' - The names of cisco VPNs and their associated definitions - ''; - }; - }; - }; - - config.environment.etc = mapAttrs' mkServiceDef cfg.services; -} - - diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 6b578cd5619f..5f4a608d74d5 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -35,7 +35,6 @@ ./config/terminfo.nix ./config/unix-odbc-drivers.nix ./config/users-groups.nix - ./config/vpnc.nix ./config/vte.nix ./config/zram.nix ./hardware/acpilight.nix diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 7d8cf55b827a..a109b26a5f3d 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -235,6 +235,7 @@ with lib; (mkRemovedOptionModule [ "services" "zabbixServer" "dbPassword" ] "Use services.zabbixServer.database.passwordFile instead.") (mkRemovedOptionModule [ "systemd" "generator-packages" ] "Use systemd.packages instead.") (mkRemovedOptionModule [ "fonts" "enableCoreFonts" ] "Use fonts.fonts = [ pkgs.corefonts ]; instead.") + (mkRemovedOptionModule [ "networking" "vpnc" ] "Use environment.etc.\"vpnc/service.conf\" instead.") # ZSH (mkRenamedOptionModule [ "programs" "zsh" "enableSyntaxHighlighting" ] [ "programs" "zsh" "syntaxHighlighting" "enable" ]) diff --git a/nixos/tests/gotify-server.nix b/nixos/tests/gotify-server.nix index 0ffc3138d5a1..c6e00686aed9 100644 --- a/nixos/tests/gotify-server.nix +++ b/nixos/tests/gotify-server.nix @@ -1,4 +1,4 @@ -import ./make-test.nix ({ pkgs, lib, ...} : { +import ./make-test-python.nix ({ pkgs, lib, ...} : { name = "gotify-server"; meta = with pkgs.stdenv.lib.maintainers; { maintainers = [ ma27 ]; @@ -14,32 +14,32 @@ import ./make-test.nix ({ pkgs, lib, ...} : { }; testScript = '' - startAll; + machine.start() - $machine->waitForUnit("gotify-server"); - $machine->waitForOpenPort(3000); + machine.wait_for_unit("gotify-server.service") + machine.wait_for_open_port(3000) - my $token = $machine->succeed( - "curl --fail -sS -X POST localhost:3000/application -F name=nixos " . - '-H "Authorization: Basic $(echo -ne "admin:admin" | base64 --wrap 0)" ' . - '| jq .token | xargs echo -n' - ); + token = machine.succeed( + "curl --fail -sS -X POST localhost:3000/application -F name=nixos " + + '-H "Authorization: Basic $(echo -ne "admin:admin" | base64 --wrap 0)" ' + + "| jq .token | xargs echo -n" + ) - my $usertoken = $machine->succeed( - "curl --fail -sS -X POST localhost:3000/client -F name=nixos " . - '-H "Authorization: Basic $(echo -ne "admin:admin" | base64 --wrap 0)" ' . - '| jq .token | xargs echo -n' - ); + usertoken = machine.succeed( + "curl --fail -sS -X POST localhost:3000/client -F name=nixos " + + '-H "Authorization: Basic $(echo -ne "admin:admin" | base64 --wrap 0)" ' + + "| jq .token | xargs echo -n" + ) - $machine->succeed( - "curl --fail -sS -X POST 'localhost:3000/message?token=$token' -H 'Accept: application/json' " . - '-F title=Gotify -F message=Works' - ); + machine.succeed( + f"curl --fail -sS -X POST 'localhost:3000/message?token={token}' -H 'Accept: application/json' " + + "-F title=Gotify -F message=Works" + ) - my $title = $machine->succeed( - "curl --fail -sS 'localhost:3000/message?since=0&token=$usertoken' | jq '.messages|.[0]|.title' | xargs echo -n" - ); + title = machine.succeed( + f"curl --fail -sS 'localhost:3000/message?since=0&token={usertoken}' | jq '.messages|.[0]|.title' | xargs echo -n" + ) - $title eq "Gotify" or die "Wrong title ($title), expected 'Gotify'!"; + assert title == "Gotify" ''; }) diff --git a/nixos/tests/xmpp/prosody-mysql.nix b/nixos/tests/xmpp/prosody-mysql.nix index 62b4a17421e5..0507227021b2 100644 --- a/nixos/tests/xmpp/prosody-mysql.nix +++ b/nixos/tests/xmpp/prosody-mysql.nix @@ -1,4 +1,4 @@ -import ../make-test.nix { +import ../make-test-python.nix { name = "prosody-mysql"; nodes = { @@ -57,21 +57,21 @@ import ../make-test.nix { }; testScript = { nodes, ... }: '' - $mysql->waitForUnit('mysql.service'); - $server->waitForUnit('prosody.service'); - $server->succeed('prosodyctl status') =~ /Prosody is running/; + mysql.wait_for_unit("mysql.service") + server.wait_for_unit("prosody.service") + server.succeed('prosodyctl status | grep "Prosody is running"') # set password to 'nothunter2' (it's asked twice) - $server->succeed('yes nothunter2 | prosodyctl adduser cthon98@example.com'); + server.succeed("yes nothunter2 | prosodyctl adduser cthon98@example.com") # set password to 'y' - $server->succeed('yes | prosodyctl adduser azurediamond@example.com'); + server.succeed("yes | prosodyctl adduser azurediamond@example.com") # correct password to 'hunter2' - $server->succeed('yes hunter2 | prosodyctl passwd azurediamond@example.com'); + server.succeed("yes hunter2 | prosodyctl passwd azurediamond@example.com") - $client->succeed("send-message"); + client.succeed("send-message") - $server->succeed('prosodyctl deluser cthon98@example.com'); - $server->succeed('prosodyctl deluser azurediamond@example.com'); + server.succeed("prosodyctl deluser cthon98@example.com") + server.succeed("prosodyctl deluser azurediamond@example.com") ''; } diff --git a/nixos/tests/xmpp/prosody.nix b/nixos/tests/xmpp/prosody.nix index 8331c7b6d331..9d1374bff6bd 100644 --- a/nixos/tests/xmpp/prosody.nix +++ b/nixos/tests/xmpp/prosody.nix @@ -1,4 +1,4 @@ -import ../make-test.nix { +import ../make-test-python.nix { name = "prosody"; nodes = { @@ -28,19 +28,19 @@ import ../make-test.nix { }; testScript = { nodes, ... }: '' - $server->waitForUnit('prosody.service'); - $server->succeed('prosodyctl status') =~ /Prosody is running/; + server.wait_for_unit("prosody.service") + server.succeed('prosodyctl status | grep "Prosody is running"') # set password to 'nothunter2' (it's asked twice) - $server->succeed('yes nothunter2 | prosodyctl adduser cthon98@example.com'); + server.succeed("yes nothunter2 | prosodyctl adduser cthon98@example.com") # set password to 'y' - $server->succeed('yes | prosodyctl adduser azurediamond@example.com'); - # correct password to 'hunter2' - $server->succeed('yes hunter2 | prosodyctl passwd azurediamond@example.com'); + server.succeed("yes | prosodyctl adduser azurediamond@example.com") + # correct password to "hunter2" + server.succeed("yes hunter2 | prosodyctl passwd azurediamond@example.com") - $client->succeed("send-message"); + client.succeed("send-message") - $server->succeed('prosodyctl deluser cthon98@example.com'); - $server->succeed('prosodyctl deluser azurediamond@example.com'); + server.succeed("prosodyctl deluser cthon98@example.com") + server.succeed("prosodyctl deluser azurediamond@example.com") ''; } |