miti.sh/spec/unixstreamsrvr.moon
Catalin Constantin Mititiuc 406208f26c Add tests for nginx.conf directives (#1)
Adds tests to make sure all the `nginx.conf` directives (the redirects and rewrites and such) are all correct.

- Uses the `busted` framework
- The tests are run in a Docker container by the bash script `test.sh`
- Self-signed certs are generated in `Dockerfile` for all the domain names
- Adds new `Makefile` commands: `test`, `image-build` and `image-rm`

Reviewed-on: #1
Co-authored-by: Catalin Mititiuc <webdevcat@proton.me>
Co-committed-by: Catalin Mititiuc <webdevcat@proton.me>
2025-06-16 20:18:05 -07:00

15 lines
390 B
Plaintext

-- modified from
-- https://github.com/lunarmodules/luasocket/blob/4844a48fbf76b0400fd7b7e4d15d244484019df1/test/unixstreamsrvr.lua
socket = require "socket"
socket.unix = require "socket.unix"
u = assert socket.unix.stream!
assert u\bind "/run/gitea/gitea.socket"
assert u\listen!
assert u\settimeout 1
c = assert u\accept!
while true
m = assert c\receive!
break if m == ""
print m