diff options
author | Ryan Lahfa <masterancpp@gmail.com> | 2023-05-14 17:09:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-14 17:09:19 +0200 |
commit | 8ef486b60e994db9e21c58e7e15b8e90d6df5936 (patch) | |
tree | 361f54a3b979affc0737e63d3492ba297cff4111 /nixos/tests/web-apps | |
parent | ef5c1750c9bc0200663e3a978af244ceeac92b80 (diff) | |
parent | f341151cfa872ff8d80d3c00e090380920cda8c5 (diff) |
Merge pull request #207194 from RaitoBezarius/pixelfed-module
pixelfed: init at 0.11.5, module, tests
Diffstat (limited to 'nixos/tests/web-apps')
-rw-r--r-- | nixos/tests/web-apps/pixelfed/default.nix | 8 | ||||
-rw-r--r-- | nixos/tests/web-apps/pixelfed/standard.nix | 38 |
2 files changed, 46 insertions, 0 deletions
diff --git a/nixos/tests/web-apps/pixelfed/default.nix b/nixos/tests/web-apps/pixelfed/default.nix new file mode 100644 index 0000000000000..4464ebe434865 --- /dev/null +++ b/nixos/tests/web-apps/pixelfed/default.nix @@ -0,0 +1,8 @@ +{ system ? builtins.currentSystem, handleTestOn }: +let + supportedSystems = [ "x86_64-linux" "i686-linux" ]; + +in +{ + standard = handleTestOn supportedSystems ./standard.nix { inherit system; }; +} diff --git a/nixos/tests/web-apps/pixelfed/standard.nix b/nixos/tests/web-apps/pixelfed/standard.nix new file mode 100644 index 0000000000000..9260e27af960d --- /dev/null +++ b/nixos/tests/web-apps/pixelfed/standard.nix @@ -0,0 +1,38 @@ +import ../../make-test-python.nix ({pkgs, ...}: +{ + name = "pixelfed-standard"; + meta.maintainers = with pkgs.lib.maintainers; [ raitobezarius ]; + + nodes = { + server = { pkgs, ... }: { + services.pixelfed = { + enable = true; + domain = "pixelfed.local"; + # Configure NGINX. + nginx = {}; + secretFile = (pkgs.writeText "secrets.env" '' + # Snakeoil secret, can be any random 32-chars secret via CSPRNG. + APP_KEY=adKK9EcY8Hcj3PLU7rzG9rJ6KKTOtYfA + ''); + settings."FORCE_HTTPS_URLS" = false; + }; + }; + }; + + testScript = '' + # Wait for Pixelfed PHP pool + server.wait_for_unit("phpfpm-pixelfed.service") + # Wait for NGINX + server.wait_for_unit("nginx.service") + # Wait for HTTP port + server.wait_for_open_port(80) + # Access the homepage. + server.succeed("curl -H 'Host: pixelfed.local' http://localhost") + # Create an account + server.succeed("pixelfed-manage user:create --name=test --username=test --email=test@test.com --password=test") + # Create a OAuth token. + # TODO: figure out how to use it to send a image/toot + # server.succeed("pixelfed-manage passport:client --personal") + # server.succeed("curl -H 'Host: pixefed.local' -H 'Accept: application/json' -H 'Authorization: Bearer secret' -F'status'='test' http://localhost/api/v1/statuses") + ''; +}) |