From c944a8a3b91c08af6fbe3963f0d169972b93e293 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Fri, 25 Jun 2010 21:11:35 +0530 Subject: [PATCH] new test: t54-repo-configs --- t/t54-repo-configs | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 t/t54-repo-configs diff --git a/t/t54-repo-configs b/t/t54-repo-configs new file mode 100644 index 0000000..4e53921 --- /dev/null +++ b/t/t54-repo-configs @@ -0,0 +1,87 @@ +# vim: syn=sh: +for wr in 0 1 +do + for bc in 0 1 + do + cd $TESTDIR + $TESTDIR/rollback || die "rollback failed" + editrc GL_WILDREPOS $wr + editrc GL_BIG_CONFIG $bc + + # ---------- + + name "fail to set foo.bar" + echo " + @leads = u1 u2 + @devs = u1 u2 u3 u4 + + repo bar + RW+ = @leads + RW = @devs + config foo.bar = baz + " | ugc + expect "remote: git config foo.bar not allowed" + runremote cat repositories/bar.git/config + notexpect '^.foo' + notexpect 'bar = baz' + + name "update rc file to allow foo.*" + catrc + cp ~/1 ~/junk + perl -pi -e 's/GL_GITCONFIG_KEYS = ""/GL_GITCONFIG_KEYS = "foo\\\\..*"/' ~/junk + cat ~/junk | runremote dd of=.gitolite.rc + catrc + expect "GL_GITCONFIG_KEYS.*foo" + + name "ok to set foo.bar" + echo " + @leads = u1 u2 + @devs = u1 u2 u3 u4 + + repo bar + RW+ = @leads + RW = @devs + config foo.bar = baz + " | ugc -r + expect "remote: Initialized empty Git repository in /home/gitolite-test/repositories/bar.git/" + notexpect "git config.*not allowed" + expect_push_ok "master -> master" + runremote cat repositories/bar.git/config + expect '^.foo' + expect 'bar = baz' + + name "fail to set foobar.baz" + echo " + @leads = u1 u2 + @devs = u1 u2 u3 u4 + + repo bar + RW+ = @leads + RW = @devs + config foo.bar = baz + config foobar.baz = ooka + " | ugc -r + expect "remote: git config foobar.baz not allowed" + runremote cat repositories/bar.git/config + expect '^.foo' + expect 'bar = baz' + notexpect '^.foobar' + notexpect 'baz = ooka' + + name "delete foo.bar" + echo " + @leads = u1 u2 + @devs = u1 u2 u3 u4 + + repo bar + RW+ = @leads + RW = @devs + config foo.bar = + " | ugc -r + runremote cat repositories/bar.git/config + expect '^.foo' + notexpect 'bar = baz' + + name INTERNAL + done +done