wip test suite

This commit is contained in:
Sitaram Chamarty 2012-03-17 18:35:26 +05:30
parent 44e6bc4bb2
commit d5ddf6c68d
3 changed files with 74 additions and 7 deletions

67
t/0-me-first.t Executable file
View file

@ -0,0 +1,67 @@
#!/usr/bin/perl
use strict;
use warnings;
# this is hardcoded; change it if needed
use lib "src";
use Gitolite::Test;
# initial smoke tests
# ----------------------------------------------------------------------
try "plan 55";
# basic push admin repo
confreset;confadd '
repo aa
RW+ = u1
RW = u2 u3
';
try "ADMIN_PUSH set1; !/FATAL/" or die text();
try "
/Initialized empty Git repository in .*/aa.git//
# basic clone
cd ..
glt clone u1 file://aa u1aa; ok; /Cloning into 'u1aa'.../
/warning: You appear to have cloned an empty repository/
ls -ald --time-style=long-iso u1aa;
ok; /drwxr-xr-x 3 $ENV{USER} $ENV{USER} 4096 201.-..-.. ..:.. u1aa/
# basic clone deny
glt clone u4 file://aa u4aa; !ok; /R any aa u4 DENIED by fallthru/
ls -ald u4aa; !ok; /ls: cannot access u4aa: No such file or directory/
# basic push
cd u1aa; ok
tc z-507; ok; /master .root-commit. 7cf7624. z-507/
glt push u1 origin HEAD; ok; /To file://aa/
/\\[new branch\\] *HEAD -> master/
# basic rewind
tc o-866 o-867 o-868; ok; /master 2d066fb. o-868/
glt push u1 origin HEAD; ok; /7cf7624..2d066fb HEAD -> master/
git reset --hard HEAD^; ok; /HEAD is now at 8b1456b o-867/
tc x-967; ok; /master 284951d. x-967/
glt push u1 -f origin HEAD; ok; /\\+ 2d066fb...284951d HEAD -> master \\(forced update\\)/
# log file
cat \$(gitolite query-rc GL_LOGFILE);
ok; /update:OK/
/aa\tu1\t\\+\trefs/heads/master/
/2d066fb4860c29cf321170c17695c6883f3d50e8/
/284951dfa11d58f99ab76b9f4e4c1ad2f2461236/
# basic rewind deny
cd ..
glt clone u2 file://aa u2aa; ok; /Cloning into 'u2aa'.../
cd u2aa; ok
tc g-776 g-777 g-778; ok; /master 9cbc181. g-778/
glt push u2 origin HEAD; ok; /284951d..9cbc181 HEAD -> master/
git reset --hard HEAD^; ok; /HEAD is now at 2edf7fc g-777/
tc d-485; ok; /master 1c01d32. d-485/
glt push u2 -f origin HEAD; !ok; reject
/\\+ refs/heads/master aa u2 DENIED by fallthru/
";

View file

@ -6,7 +6,7 @@ use warnings;
use lib "src"; use lib "src";
use Gitolite::Test; use Gitolite::Test;
# basic tests # test 'gitolite access'
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
try "plan 185"; try "plan 185";

View file

@ -6,14 +6,14 @@ use warnings;
use lib "src"; use lib "src";
use Gitolite::Test; use Gitolite::Test;
# basic tests # some more basic tests
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
try " try "
plan 218 plan 218
CHECK_SETUP CHECK_SETUP
## subtest 1 # subtest 1
cd .. cd ..
CLONE dev2 file://gitolite-admin ga2 CLONE dev2 file://gitolite-admin ga2
!ok; gsh !ok; gsh
@ -67,7 +67,7 @@ put "conf/gitolite.conf", "
"; ";
try " try "
## subtest 2 # subtest 2
ADMIN_PUSH t01b ADMIN_PUSH t01b
# clone # clone
@ -124,7 +124,7 @@ put "../gitolite-admin/conf/i1.conf", "
"; ";
try " try "
## subtest 3 # subtest 3
ADMIN_PUSH t01c ADMIN_PUSH t01c
cd ..; ok cd ..; ok
@ -239,7 +239,7 @@ put "| cat >> ../gitolite-admin/conf/gitolite.conf", "
"; ";
try " try "
## subtest 4 # subtest 4
ADMIN_PUSH t01d ADMIN_PUSH t01d
cd ..; ok cd ..; ok
@ -266,7 +266,7 @@ put "| cat >> ../gitolite-admin/conf/gitolite.conf", "
"; ";
try " try "
## subtest 5 # subtest 5
ADMIN_PUSH t01e ADMIN_PUSH t01e
cd ..; ok cd ..; ok