Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Say when logins are unavailable
The way back was signed part way through the form, so while the secret's
directory did not exist, or a library was missing, cgit's error landed
inside the hidden input and the page broke off there with no fields.
Diffstat (limited to 'tests/extensions/harness.lua')
| -rw-r--r-- | tests/extensions/harness.lua | 21 |
1 file changed, 21 insertions, 0 deletions
diff --git a/tests/extensions/harness.lua b/tests/extensions/harness.lua index 2fe722f..8c1ba6c 100644 --- a/tests/extensions/harness.lua +++ b/tests/extensions/harness.lua @@ -54,14 +54,30 @@ html_url_path = sink(function(s) end)) end) +-- What a script writes to standard error goes to the web server's error log +-- under cgit, so it is kept here for a check to read instead. +local logged = {} + +io.stderr = { + write = function(self, ...) + logged[#logged + 1] = table.concat({ ... }) + return self + end, +} + function harness.reset() pieces = {} + logged = {} end function harness.output() return table.concat(pieces) end +function harness.error_log() + return table.concat(logged) +end + function harness.load(script) dofile(script) end @@ -182,6 +198,11 @@ function harness.stub_auth_modules() preload("posix.unistd", { crypt = fake_crypt, }) + preload("posix.sys.stat", { + umask = function() + return 18 + end, + }) preload("openssl.rand", { bytes = function(count) local out = {} |
