diff options
author | 2014-12-10 12:37:11 +0530 | |
---|---|---|
committer | 2014-12-15 10:30:58 +0530 | |
commit | b8eb687840f1b30cb6c99ef846035c8d5e7b92e4 (patch) | |
tree | a5708c6e3cedc59640dc06735ed89babc67d2c2d /t | |
parent | new transparent proxy feature; see comments in source (diff) | |
download | gitolite-gentoo-b8eb687840f1b30cb6c99ef846035c8d5e7b92e4.tar.gz gitolite-gentoo-b8eb687840f1b30cb6c99ef846035c8d5e7b92e4.tar.bz2 gitolite-gentoo-b8eb687840f1b30cb6c99ef846035c8d5e7b92e4.zip |
test setup should now work in FreeBSD also...
- git 2.x
- some umask/perm issues in mirror test setup
- some paths and system commands in smart http setup
Diffstat (limited to 't')
-rwxr-xr-x | t/info-json.t | 2 | ||||
-rwxr-xr-x | t/mirror-test-setup.sh | 2 | ||||
-rwxr-xr-x | t/smart-http.root-setup | 39 |
3 files changed, 34 insertions, 9 deletions
diff --git a/t/info-json.t b/t/info-json.t index a78b79f..74fbdf4 100755 --- a/t/info-json.t +++ b/t/info-json.t @@ -171,7 +171,7 @@ sub test_gs { try 'perl $_ = "' . $res . '"; /1/'; $res = ( $href->{gitolite_version} =~ /^v3.[5-9]/ ? 1 : 'undef' ); try 'perl $_ = "' . $res . '"; /1/'; - $res = ( $href->{git_version} =~ /^1.[6-9]/ ? 1 : 'undef' ); + $res = ( $href->{git_version} =~ /^1.[6-9]|^2./ ? 1 : 'undef' ); try 'perl $_ = "' . $res . '"; /1/'; } diff --git a/t/mirror-test-setup.sh b/t/mirror-test-setup.sh index 02a286a..b35364c 100755 --- a/t/mirror-test-setup.sh +++ b/t/mirror-test-setup.sh @@ -30,6 +30,7 @@ cd /tmp/g3 done cp $bd/../t/mirror-test-ssh-config ssh-config } +chmod -R go+rX /tmp/g3 for h in $hosts do @@ -96,6 +97,7 @@ RW = u1 for h in $hosts do cat $bd/../t/mirror-test-rc | perl -pe "s/%HOSTNAME/$h/" > /tmp/g3/temp + chmod go+rX /tmp/g3/temp sudo -u $h -i cp /tmp/g3/temp .gitolite.rc echo "$lines" | sudo -u $h -i sh -c 'cat >> .gitolite/conf/gitolite.conf' echo "$lines2" | sudo -u $h -i sh -c "cat >> .gitolite/conf/$h.conf" diff --git a/t/smart-http.root-setup b/t/smart-http.root-setup index 310efa3..7a46dda 100755 --- a/t/smart-http.root-setup +++ b/t/smart-http.root-setup @@ -17,13 +17,32 @@ die() { echo "$@"; exit 1; } exit 1 } -id | grep '=0(root)' || die "you must run this as root" +# ---------------------------------------------------------------------- +# are we *BSD or Linux? +uname_s=`uname -s` # could be Linux or FreeBSD or some other BSD +if [ "$uname_s" = "Linux" ] +then + bsd=: +else + lnx=: +fi + +# ---------------------------------------------------------------------- +# main + +[ $EUID = 0 ] || die "you must run this as root" # delete any existing apache conf for gitolite -rm /etc/httpd/conf.d/gitolite.conf +$lnx rm /etc/httpd/conf.d/gitolite.conf +$bsd rm /usr/local/etc/apache24/Includes/gitolite.conf # build your "home within a home" -cd ~apache +$lnx cd ~apache +$bsd rm -rf /tmp/usr.share.httpd +$bsd mkdir -p /tmp/usr.share.httpd +$bsd chown www:www /tmp/usr.share.httpd +$bsd cd /tmp/usr.share.httpd + rm -rf gitolite-home mkdir gitolite-home export GITOLITE_HTTP_HOME=$PWD/gitolite-home @@ -52,12 +71,13 @@ cat .gitolite.rc >> 1 \mv 1 .gitolite.rc # fix up ownership -chown -R apache.apache $GITOLITE_HTTP_HOME +$lnx chown -R apache:apache $GITOLITE_HTTP_HOME +$bsd chown -R www:www $GITOLITE_HTTP_HOME # create the apache config. Note the trailing slashes on the 2 ScriptAlias # lines. (The second one is optional for most sites). NOTE: you also need to # give the AuthUserFile a better name/location than what I have below. -cat <<EOF1 > /etc/httpd/conf.d/gitolite.conf +cat <<EOF1 > 1 SetEnv GIT_PROJECT_ROOT $GITOLITE_HTTP_HOME/repositories ScriptAlias /git/ $GITOLITE_HTTP_HOME/gitolite-source/src/gitolite-shell/ ScriptAlias /gitmob/ $GITOLITE_HTTP_HOME/gitolite-source/src/gitolite-shell/ @@ -71,12 +91,15 @@ SetEnv GIT_HTTP_EXPORT_ALL AuthUserFile $GITOLITE_HTTP_HOME/gitolite-http-authuserfile </Location> EOF1 +$lnx mv 1 /etc/httpd/conf.d/gitolite.conf +$bsd mv 1 /usr/local/etc/apache24/Includes/gitolite.conf # NOTE: this is for testing only htpasswd -bc $GITOLITE_HTTP_HOME/gitolite-http-authuserfile admin admin map "htpasswd -b $GITOLITE_HTTP_HOME/gitolite-http-authuserfile % %" u{1..6} -chown apache.apache $GITOLITE_HTTP_HOME/gitolite-http-authuserfile +$lnx chown apache:apache $GITOLITE_HTTP_HOME/gitolite-http-authuserfile +$bsd chown www:www $GITOLITE_HTTP_HOME/gitolite-http-authuserfile # restart httpd to make it pick up all the new stuff -service httpd restart - +$lnx service httpd restart +$bsd /usr/local/etc/rc.d/apache24 restart |