WIP: module qois.cloud: add basic test #77

Draft
das-g wants to merge 2 commits from test-cloud into main
Owner
No description provided.
das-g added 2 commits 2025-06-14 21:36:47 +02:00
qois.cloud: add basic test (WIP)
Some checks failed
CI / build (push) Failing after 2m34s
CI / deploy (docs-ops.qo.is) (push) Has been skipped
CI / deploy (system-physical) (push) Has been skipped
CI / deploy (system-vm) (push) Has been skipped
a072ba0dd7
Author
Owner

currently fails. Excerpt from the log:

[…]
webserver # [   33.065760] AES CTR mode by8 optimization enabled
webserver: (finished: must succeed: grep cloud.example.com /etc/hosts, in 0.28 seconds)
webserver: must succeed: curl -s --no-location -o /dev/null -w '%{http_code}' 'http://cloud.example.com'
webserver # [   33.133920] Console: switching to colour frame buffer device 160x50
webserver # [   33.377503] bochs-drm 0000:00:02.0: [drm] fb0: bochs-drmdrmfb frame buffer device
webserver # [   32.789737] systemd-logind[659]: Watching system buttons on /dev/input/event0 (AT Translated Set 2 keyboard)
webserver # [   32.958597] systemd[1]: Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
webserver # [   32.994113] systemd-vconsole-setup[937]: Failed to enable UTF-8 kbdmode on /dev/tty1: Input/output error
webserver # [   33.239842] nginx[928]: 2025/06/14 18:35:39 [crit] 928#928: *2 connect() to unix:/run/phpfpm/nextcloud.sock failed (2: No such file or directory) while connecting to upstream, client: ::1, server: cloud.example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/phpfpm/nextcloud.sock:", host: "cloud.example.com"
webserver # [   33.259933] systemd-logind[659]: Watching system buttons on /dev/input/event2 (Power Button)
webserver: (finished: must succeed: curl -s --no-location -o /dev/null -w '%{http_code}' 'http://cloud.example.com', in 0.60 seconds)
!!! Test "website is successfully served on cloud.example.com" failed with error: "expected http_code to be '200' but got '502'"
cleanup
kill machine (pid 11)
qemu-system-x86_64: terminating on signal 15 from pid 8 (/nix/store/8w718rm43x7z73xhw9d6vh8s4snrq67h-python3-3.12.10/bin/python3.12)
[…]

Is Failed to enable UTF-8 kbdmode on /dev/tty1: Input/output error or [crit] 928#928: *2 connect() to unix:/run/phpfpm/nextcloud.sock failed (2: No such file or directory) while connecting to upstream, client: ::1, server: cloud.example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/phpfpm/nextcloud.sock:", host: "cloud.example.com" the culprit?

currently fails. Excerpt from the log: ``` […] webserver # [ 33.065760] AES CTR mode by8 optimization enabled webserver: (finished: must succeed: grep cloud.example.com /etc/hosts, in 0.28 seconds) webserver: must succeed: curl -s --no-location -o /dev/null -w '%{http_code}' 'http://cloud.example.com' webserver # [ 33.133920] Console: switching to colour frame buffer device 160x50 webserver # [ 33.377503] bochs-drm 0000:00:02.0: [drm] fb0: bochs-drmdrmfb frame buffer device webserver # [ 32.789737] systemd-logind[659]: Watching system buttons on /dev/input/event0 (AT Translated Set 2 keyboard) webserver # [ 32.958597] systemd[1]: Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch. webserver # [ 32.994113] systemd-vconsole-setup[937]: Failed to enable UTF-8 kbdmode on /dev/tty1: Input/output error webserver # [ 33.239842] nginx[928]: 2025/06/14 18:35:39 [crit] 928#928: *2 connect() to unix:/run/phpfpm/nextcloud.sock failed (2: No such file or directory) while connecting to upstream, client: ::1, server: cloud.example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/phpfpm/nextcloud.sock:", host: "cloud.example.com" webserver # [ 33.259933] systemd-logind[659]: Watching system buttons on /dev/input/event2 (Power Button) webserver: (finished: must succeed: curl -s --no-location -o /dev/null -w '%{http_code}' 'http://cloud.example.com', in 0.60 seconds) !!! Test "website is successfully served on cloud.example.com" failed with error: "expected http_code to be '200' but got '502'" cleanup kill machine (pid 11) qemu-system-x86_64: terminating on signal 15 from pid 8 (/nix/store/8w718rm43x7z73xhw9d6vh8s4snrq67h-python3-3.12.10/bin/python3.12) […] ``` Is `Failed to enable UTF-8 kbdmode on /dev/tty1: Input/output error` or `[crit] 928#928: *2 connect() to unix:/run/phpfpm/nextcloud.sock failed (2: No such file or directory) while connecting to upstream, client: ::1, server: cloud.example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/phpfpm/nextcloud.sock:", host: "cloud.example.com"` the culprit?
Author
Owner

@das-g wrote in #77 (comment):

Is Failed to enable UTF-8 kbdmode on /dev/tty1: Input/output error or [crit] 928#928: *2 connect() to unix:/run/phpfpm/nextcloud.sock failed (2: No such file or directory) while connecting to upstream, client: ::1, server: cloud.example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/phpfpm/nextcloud.sock:", host: "cloud.example.com" the culprit?

In the CI result, I can only spot the second of those. (here)

@das-g wrote in https://git.qo.is/qo.is/infrastructure/pulls/77#issuecomment-445: > Is `Failed to enable UTF-8 kbdmode on /dev/tty1: Input/output error` or `[crit] 928#928: *2 connect() to unix:/run/phpfpm/nextcloud.sock failed (2: No such file or directory) while connecting to upstream, client: ::1, server: cloud.example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/phpfpm/nextcloud.sock:", host: "cloud.example.com"` the culprit? In the CI result, I can only spot the second of those. ([here](https://git.qo.is/qo.is/infrastructure/actions/runs/236/jobs/0#jobstep-3-2135))
fabianhauser reviewed 2025-06-19 20:56:30 +02:00
@ -0,0 +21,4 @@
sops.secrets = mkForce { };
# Disable TLS services
services.nginx.virtualHosts = genAttrs [ "cloud.example.com" ] (const {
Owner

genAttrs is not needed here, since we only have one attr

`genAttrs` is not needed here, since we only have one attr
das-g marked this conversation as resolved
@ -0,0 +1,32 @@
def test(subtest, webserver):
webserver.wait_for_unit("nginx")
Owner

You need to wait for the phpfpm-nextcloud.service to be up and running (and maybe nextcloud-setup.service, it's a oneshot service tough).

You need to wait for the `phpfpm-nextcloud.service` to be up and running (and maybe `nextcloud-setup.service`, it's a oneshot service tough).
Author
Owner

Or should we just wait for multi-user.target like nixos/tests/nextcloud/default.nix does?

Or should we just wait for `multi-user.target` like [nixos/tests/nextcloud/default.nix](https://github.com/NixOS/nixpkgs/blob/86c02c145a0b6ae0fab47564e0a003a967203f46/nixos/tests/nextcloud/default.nix#L80) does?
das-g force-pushed test-cloud from a072ba0dd7 to a76519ac01 2025-06-21 10:26:44 +02:00 Compare
Some checks failed
CI / build (push) Failing after 19m20s
CI / deploy (docs-ops.qo.is) (push) Has been skipped
CI / deploy (system-physical) (push) Has been skipped
CI / deploy (system-vm) (push) Has been skipped
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin test-cloud:test-cloud
git checkout test-cloud
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: qo.is/infrastructure#77
No description provided.