Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Write the auth test configs through cgitrc_repo
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0505-auth.sh | 29 |
1 file changed, 4 insertions, 25 deletions
diff --git a/tests/t0505-auth.sh b/tests/t0505-auth.sh index ae5e299..3b45dd3 100755 --- a/tests/t0505-auth.sh +++ b/tests/t0505-auth.sh @@ -102,13 +102,7 @@ then fi test_expect_success CGIT_LUA 'point cgit at the unedited auth filter' ' - cat >cgitrc <<-EOF - virtual-root=/ - cache-size=0 - auth-filter=lua:$EXTENSIONS_DIRECTORY/auth-inline.lua - repo.url=authy - repo.path=$PWD/repos/authy/.git - EOF + cgitrc_repo cgitrc authy "auth-filter=lua:$EXTENSIONS_DIRECTORY/auth-inline.lua" ' test_expect_success CGIT_LUA 'an unedited copy protects nothing' ' @@ -127,13 +121,7 @@ test_expect_success CGIT_LUA_NOAUTH 'without the modules a protected repository awk -v secret="$PWD/guarded-secret" -f protect.awk "$EXTENSIONS_DIRECTORY/auth-inline.lua" >guarded.lua && grep "\"authy\"" guarded.lua && grep "guarded-secret" guarded.lua && - cat >guardedrc <<-EOF && - virtual-root=/ - cache-size=0 - auth-filter=lua:$PWD/guarded.lua - repo.url=authy - repo.path=$PWD/repos/authy/.git - EOF + cgitrc_repo guardedrc authy "auth-filter=lua:$PWD/guarded.lua" && cgit_rc guardedrc "url=authy/log/" >tmp 2>err && ! grep "guarded commit" tmp && grep "<p class=.login-error. role=.alert.>Logins are unavailable" tmp && @@ -223,17 +211,8 @@ test_expect_success 'the login page keeps the repository to itself' ' test "$1" = body && echo "<p>sign in</p>" exit 0 EOF - cat >denyrc <<-EOF && - virtual-root=/ - cache-size=0 - root-desc=the whole site - auth-filter=exec:$PWD/deny.sh - repo.url=authy - repo.path=$PWD/repos/authy/.git - repo.desc=the secret plan - repo.owner=Mallory Owner - repo.hide=1 - EOF + cgitrc_repo denyrc authy "root-desc=the whole site" "auth-filter=exec:$PWD/deny.sh" \ + "repo.desc=the secret plan" "repo.owner=Mallory Owner" "repo.hide=1" && cgit_rc denyrc "url=authy/log/" >tmp && grep "<p>sign in</p>" tmp && grep "<p class=.sub desc.>the whole site</p>" tmp && |
