gitolite/t
Sitaram Chamarty 85da5572b2 some nice ADC changes... (warning: minor backward compat breakage)
- support for ADCs with unchecked arguments
  - rsync, htpasswd, and svnserve gone from core; turned into ADCs

Backward compat breakage and fix: Please see documentation for details,
but if you're using gitolite to control rsync you will now need to setup
ADCs (admin defined commands), and install at least the new "rsync" ADC.

----

Thanks to Joey Hess (see commit prior to this) for forcing me to stop
being lazy and get this out of my long term todo list.
2011-10-17 18:42:57 +05:30
..
keys (test suite) t/install also serves as a quick way to "play install" gitolite 2011-10-11 13:53:57 +05:30
out fix sequencing for repo config statements 2011-08-17 21:03:14 +05:30
basic.conf finally, open up my secret test scripts... 2010-06-12 13:24:55 +05:30
install (test suite) t/install also serves as a quick way to "play install" gitolite 2011-10-11 13:53:57 +05:30
README.mkd (test suite) added documentation for changes 2011-10-11 15:03:31 +05:30
rollback (test suite) t/install also serves as a quick way to "play install" gitolite 2011-10-11 13:53:57 +05:30
rollback.server (test suite) t/install also serves as a quick way to "play install" gitolite 2011-10-11 13:53:57 +05:30
t-fedora-big-config (minor) updated fedora test case to add new RC vars introduced 2 commits in HEAD^^ 2010-07-30 08:48:20 +05:30
t00-initial make REPO_BASE absolute early 2011-03-21 07:51:10 +05:30
t01-repo-groups (major change in big-config mode) split the compiled config file 2011-01-02 11:30:29 +05:30
t02-user-groups (major change in big-config mode) split the compiled config file 2011-01-02 11:30:29 +05:30
t03-branch-permissions test suite: catch internal errors better 2010-06-18 22:09:30 +05:30
t03a-branch-permissions lots of changes to tests for big-config 2010-08-11 22:38:16 +05:30
t04-wild test suite: catch internal errors better 2010-06-18 22:09:30 +05:30
t04a-wild-all make REPO_BASE absolute early 2011-03-21 07:51:10 +05:30
t04a-wild-students make REPO_BASE absolute early 2011-03-21 07:51:10 +05:30
t05-delegation (tests) added tests for delegating with wildcards 2010-08-21 10:48:39 +05:30
t05a-delegation new 'subconf' feature to explicitly do delegation 2011-08-30 20:50:34 +05:30
t05b-delegation-wild new 'subconf' feature to explicitly do delegation 2011-08-30 20:50:34 +05:30
t09-oldtests finally, open up my secret test scripts... 2010-06-12 13:24:55 +05:30
t09a-oldtests put single quotes around bad user/repo names etc 2011-10-06 21:09:55 +05:30
t10-all-yall (test suite) remove hardcoded username 'gitolite-test' 2011-10-11 13:53:58 +05:30
t11-deny-repo (test suite) remove hardcoded username 'gitolite-test' 2011-10-11 13:53:58 +05:30
t50-sequence-test make REPO_BASE absolute early 2011-03-21 07:51:10 +05:30
t51-personal-branches lots of changes to tests for big-config 2010-08-11 22:38:16 +05:30
t52-deny-create-ref lots of changes to tests for big-config 2010-08-11 22:38:16 +05:30
t53-check-info-expand-output (minor) change to version reporting 2011-09-10 11:08:54 +05:30
t54-repo-configs make REPO_BASE absolute early 2011-03-21 07:51:10 +05:30
t55-repo-configs-wild-without-CREATOR rc: get rid of GL_GITCONFIG_WILD 2011-08-17 21:53:06 +05:30
t56-repo-configs-wild-with-CREATOR rc: get rid of GL_GITCONFIG_WILD 2011-08-17 21:53:06 +05:30
t57-daemon-gitweb (test suite) remove hardcoded username 'gitolite-test' 2011-10-11 13:53:58 +05:30
t58-daemon-gitweb-wild (test suite) remove hardcoded username 'gitolite-test' 2011-10-11 13:53:58 +05:30
t59-repo-not-on-disk make REPO_BASE absolute early 2011-03-21 07:51:10 +05:30
t60-daemon-gitweb-via-setperms (test suite) remove hardcoded username 'gitolite-test' 2011-10-11 13:53:58 +05:30
t61-setperms-groups make REPO_BASE absolute early 2011-03-21 07:51:10 +05:30
t62-rule-sequences make REPO_BASE absolute early 2011-03-21 07:51:10 +05:30
t63-perm-cats make REPO_BASE absolute early 2011-03-21 07:51:10 +05:30
t64-write-able (test suite) dont put adc's in /tmp 2011-10-11 13:53:58 +05:30
t65-rsync some nice ADC changes... (warning: minor backward compat breakage) 2011-10-17 18:42:57 +05:30
t67-hub (test suite) dont put adc's in /tmp 2011-10-11 13:53:58 +05:30
t68-include fix a rather large typo/thinko in 1006eba 2011-09-10 19:46:37 +05:30
t69-bad-ref-file-names tighten up ref/file names (warning: possible backward compat breakage) 2011-10-01 15:19:50 +05:30
test-driver.sh (test suite) dont put adc's in /tmp 2011-10-11 13:53:58 +05:30

notes on the testing setup

WARNING: PLEASE use a dedicated user for doing this. Various files and directories get overwritten and it's much simpler this way.

In this document:

terminology

#define PW "patches welcome!"
#define TODO PW

notes and background

All testing is done on one brand new userid. We use ssh host alias tricks to simulate multiple gitolite users within this, so ssh gitolite info gets you different results than ssh u1 info.

The test suite is mainly meant for testing the core (access control) functionality. It doesn't test anything else, like say the install or upgrade operations. Other big features NOT covered by the test suite are mirroring, smart http, and password-based access.

Note that the test driver has evolved as new scripts were added; you will see that older scripts are a little less sophisticated.

playing with gitolite

(Please heed the warning at the top of this document and use a dedicated user for this).

Playing with gitolite is easy.

  • Create a userid (doesn't matter what it's called; we'll pretend it's "gl-test" in this document).

  • Make sure sshd allows incoming ssh to this userid at least from localhost. (Out of scope for this document: sshd config, 'AllowUsers', etc...)

  • Now log in as this user (doesn't matter how), and run the following commands:

    cd $HOME        # if not already in $HOME
    git clone git://github.com/sitaramc/gitolite
    gitolite/t/install
    

    This installs the "testbed" in the userid you chose. No other user is affected in any way.

This is what you get when you do this:

  • A gitolite user called "tester", tied to an ssh host alias called "gitolite". This user has RW+ rights to the admin repo; running ssh gitolite info should get you the expected results.

  • Six gitolite users called "u1" through "u6", all done through ssh host aliases. Running ssh u1 info etc. should show you only the "testing" repo accessible to them.

  • A clone of the admin repo in ~/gitolite-admin, created by git clone gitolite:gitolite-admin. If you cd ~/gitolite-admin, you will see the keys for the users mentioned above (tester, u1, ..., u6).

  • The rest of a gitolite installation, such as the rc file in ~/.gitolite.rc etc.

Don't forget that the client and the server are all on the same user on the same machine.

And don't forget, too, that we are simulating 7 gitolite users using ssh keys! (How? Maybe ~/.ssh/config will give you a hint). You can now use those 7 users in any way you please in the config file and test out different user's access simply using a different URL. For example, git clone u1:testing and git clone u2:testing may give you different results depending on what rights you gave users "u1" and "u2" in your config.

testing gitolite

First, do what the "playing with gitolite" section says. That is a pre-requisite.

Once that is done, run this command (still in $HOME of the gl-test userid):

prove gitolite/t/test-driver.sh

(note: to make it work easier with prove, I ended up making the "subtest" numbers be the actual test numbers, making it look like I have over 2000 tests, when in reality I have about 600)

instructions for adding new tests

(TODO)