diff options
author | Marek Mahut <marek.mahut@gmail.com> | 2020-08-05 11:55:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-05 11:55:40 +0200 |
commit | 258ca6451d48d1f0de345f62c85e6e13dde805c7 (patch) | |
tree | 6853ee186dbaef640b7377b8ce400e6b4913758f /nixos/tests/dokuwiki.nix | |
parent | 0bc37f7cb40dfde509000b22a9e8f5c231d5250e (diff) | |
parent | 20f052b6f69845ac92428524e22418fe4fc188eb (diff) |
Merge pull request #94617 from dadada/dadada/dokuwiki
nixos/dokuwiki: add test for login
Diffstat (limited to 'nixos/tests/dokuwiki.nix')
-rw-r--r-- | nixos/tests/dokuwiki.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/tests/dokuwiki.nix b/nixos/tests/dokuwiki.nix index 260316a3833b..6afb6dcfda3d 100644 --- a/nixos/tests/dokuwiki.nix +++ b/nixos/tests/dokuwiki.nix @@ -41,7 +41,7 @@ in { superUser = "admin"; }; services.dokuwiki."site2.local" = { - aclUse = true; + usersFile = "/var/lib/dokuwiki/site2.local/users.auth.php"; superUser = "admin"; templates = [ template-bootstrap3 ]; plugins = [ plugin-icalevents ]; @@ -62,6 +62,15 @@ in { machine.wait_for_open_port(80) machine.succeed("curl -sSfL http://site1.local/ | grep 'DokuWiki'") + machine.fail("curl -sSfL 'http://site1.local/doku.php?do=login' | grep 'Login'") + machine.succeed("curl -sSfL http://site2.local/ | grep 'DokuWiki'") + machine.succeed("curl -sSfL 'http://site2.local/doku.php?do=login' | grep 'Login'") + + machine.succeed( + "echo 'admin:$2y$10$ijdBQMzSVV20SrKtCna8gue36vnsbVm2wItAXvdm876sshI4uwy6S:Admin:admin@example.test:user' >> /var/lib/dokuwiki/site2.local/users.auth.php", + "curl -sSfL -d 'u=admin&p=password' --cookie-jar cjar 'http://site2.local/doku.php?do=login'", + "curl -sSfL --cookie cjar --cookie-jar cjar 'http://site2.local/doku.php?do=login' | grep 'Logged in as: <bdi>Admin</bdi>'", + ) ''; }) |