diff options
author | dadada <dadada@dadada.li> | 2020-03-29 22:39:14 +0200 |
---|---|---|
committer | dadada <dadada@dadada.li> | 2020-04-18 23:37:18 +0200 |
commit | dc7ed066152f88ca5f9928db6165f62bf4f957b5 (patch) | |
tree | 1f24bd4dc98eeb9b8f2f87b14dbd55660a960dd4 /nixos/tests/dokuwiki.nix | |
parent | e233a9d4dd1484d2b79e496d45f5e785642638ef (diff) |
nixos/dokuwiki: add <name?> option
Enables multi-site configurations.
This break compatibility with prior configurations that expect options
for a single dokuwiki instance in `services.dokuwiki`.
Diffstat (limited to 'nixos/tests/dokuwiki.nix')
-rw-r--r-- | nixos/tests/dokuwiki.nix | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/nixos/tests/dokuwiki.nix b/nixos/tests/dokuwiki.nix index 38bde10f47ed..65d2677dd3ab 100644 --- a/nixos/tests/dokuwiki.nix +++ b/nixos/tests/dokuwiki.nix @@ -1,29 +1,42 @@ -import ./make-test-python.nix ({ lib, ... }: - -with lib; +import ./make-test-python.nix ({ pkgs, ... }: { name = "dokuwiki"; - meta.maintainers = with maintainers; [ maintainers."1000101" ]; - - nodes.machine = - { pkgs, ... }: - { services.dokuwiki = { - enable = true; - acl = " "; - superUser = null; - nginx = { - forceSSL = false; - enableACME = false; - }; - }; + meta.maintainers = with pkgs.lib.maintainers; [ "1000101" ]; + + machine = { ... }: { + services.dokuwiki."site1.local" = { + acl = " "; + superUser = null; + nginx = { + forceSSL = false; + enableACME = false; + }; }; + services.dokuwiki."site2.local" = { + acl = " "; + superUser = null; + nginx = { + forceSSL = false; + enableACME = false; + }; + }; + networking.hosts."127.0.0.1" = [ "site1.local" "site2.local" ]; + }; testScript = '' - machine.start() - machine.wait_for_unit("phpfpm-dokuwiki.service") + site_names = ["site1.local", "site2.local"] + + start_all() + + machine.wait_for_unit("phpfpm-dokuwiki-site1.local.service") + machine.wait_for_unit("phpfpm-dokuwiki-site2.local.service") + machine.wait_for_unit("nginx.service") + machine.wait_for_open_port(80) - machine.succeed("curl -sSfL http://localhost/ | grep 'DokuWiki'") + + machine.succeed("curl -sSfL http://site1.local/ | grep 'DokuWiki'") + machine.succeed("curl -sSfL http://site2.local/ | grep 'DokuWiki'") ''; }) |