Move socket test server file into spec dir
This commit is contained in:
parent
74632be2e1
commit
63f50820bd
@ -104,14 +104,20 @@ describe "http://miti.sh/posts", ->
|
||||
assert.same request\body!\match("<title>(.*)</title>"), "miti.sh · Posts"
|
||||
|
||||
describe "http://git.miti.sh", ->
|
||||
it "reverse proxies request to unix socket", ->
|
||||
os.execute "mkdir /run/gitea"
|
||||
p = io.popen "luajit unixstreamsrvr.lua"
|
||||
os.execute("sleep 1")
|
||||
os.execute("chown -R nobody /run/gitea")
|
||||
it "reverse proxies request to gitea through a unix socket", ->
|
||||
Path = require "sitegen.path"
|
||||
filename = "unixstreamsrvr.lua"
|
||||
socket_dir = "/run/gitea"
|
||||
info = debug.getinfo 1
|
||||
basepath = Path.basepath info.short_src
|
||||
|
||||
os.execute "mkdir " .. socket_dir
|
||||
p = io.popen "luajit %s"\format Path.join basepath, filename
|
||||
os.execute "sleep 0"
|
||||
os.execute "chown -R nobody " .. socket_dir
|
||||
|
||||
request = req "http://git.miti.sh"
|
||||
assert.is_not_nil p\read"*a"\match "Host: git.miti.sh"
|
||||
assert.truthy p\read"*a"\match "Host: git.miti.sh"
|
||||
|
||||
describe "http://apps.miti.sh", ->
|
||||
it "doesn't find it", ->
|
||||
|
Loading…
x
Reference in New Issue
Block a user