|
25 | 25 | }; |
26 | 26 | in |
27 | 27 | lib.mapAttrs (name: test: pkgs.testers.runNixOSTest (test // { inherit name defaults; })) { |
28 | | - application-tests = { |
29 | | - nodes.server = _: { imports = [ ./configuration.nix ]; }; |
30 | | - # run all application-level tests managed by Django |
31 | | - # https://docs.djangoproject.com/en/5.0/topics/testing/overview/ |
32 | | - testScript = '' |
33 | | - server.wait_for_unit("${application}-server.service") |
34 | | - server.succeed("manage test shared") |
35 | | - server.succeed("manage test webview") |
36 | | - ''; |
37 | | - }; |
38 | | - css = { |
39 | | - nodes.server = _: { imports = [ ./web-security-tracker.nix ]; }; |
40 | | - # check that the style sheet is served |
41 | | - testScript = '' |
42 | | - server.wait_for_unit("${application}-server.service") |
43 | | - server.wait_for_open_port(8000) |
44 | | - machine.succeed("curl --fail -H 'Host: example.org' http://127.0.0.1:80/static/style.css") |
45 | | - ''; |
46 | | - }; |
47 | | - admin = { |
| 28 | + basic = { |
48 | 29 | nodes.server = _: { imports = [ ./web-security-tracker.nix ]; }; |
49 | | - # check that the admin interface is served |
50 | 30 | testScript = '' |
51 | 31 | server.wait_for_unit("${application}-server.service") |
52 | | - server.wait_for_open_port(8000) |
53 | | - server.succeed("curl --fail -L -H 'Host: example.org' http://localhost/admin") |
| 32 | + server.wait_for_unit("${application}-worker.service") |
| 33 | +
|
| 34 | + with subtest("Django application tests"): |
| 35 | + # https://docs.djangoproject.com/en/5.0/topics/testing/overview/ |
| 36 | + server.succeed("wst-manage test shared") |
| 37 | + server.succeed("wst-manage test webview") |
| 38 | +
|
| 39 | + with subtest("Check that stylesheet is served"): |
| 40 | + machine.succeed("curl --fail -H 'Host: example.org' http://localhost/static/style.css") |
| 41 | +
|
| 42 | + with subtest("Check that admin interface is served"): |
| 43 | + server.succeed("curl --fail -L -H 'Host: example.org' http://localhost/admin") |
54 | 44 | ''; |
55 | 45 | }; |
56 | 46 | } |
0 commit comments