gitolite/t
Sitaram Chamarty 047790140a custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE)
THE COMPILED CONFIG FILE FORMAT CHANGES WITH THIS VERSION.  PLEASE DO
NOT MIX VERSIONS OR DOWNGRADE.  Upgrading using normal gitolite upgrade
means should be fine, though.

Originally, we only allowed "R" and "RW" as categories of users supplied
to the `setperms` command.  These map respectively to "READERS" and
"WRITERS" in the access rules.

Now:

  - we prefer READERS instead of R and WRITERS instead of RW
  - we allow the admin to define other categories as she wishes
    (example: MANAGERS, TESTERS, etc).  These do not have abbreviations,
    however, so they must be supplied in full.

PLEASE, *PLEASE*, read the section in doc/wildcard-repositories.mkd for
more info.  This is a VERY powerful feature and if you're not careful
you could mess up the ACLs nicely.

Backward compat note: you can continue to use the "R" and "RW"
categories when running the "setperms" command, and gitolite will
internally convert them to READERS and WRITERS categories.

----

implementation notes:

  - new RC var called GL_WILDREPOS_PERM_CATS that is a space-sep list of
    the allowed categories in a gl-perms file; defaults to "R RW" if not
    specified

  - wild_repo_rights no longer returns $c, $r, $wC, where $r = $user if
    "R $user", $r = '@all' if "R @all", and similarly with $w and "RW".

    Instead it returns $c and a new hash that effectively gives the same
    info, but expanded to include any other valid categories (listed in
    GL_WILDREPOS_PERM_CATS)

  - consequently, the arguments that parse_acl takes also change the
    same way

  - (side note: R and RW are quietly converted to READERS and WRITERS;
    however, new categories that you define yourself do not have
    abbreviations)

  - setperms validates perms to make sure only allowed categories are
    used; however even if someone changed them behind the scenes,
    wild_repo_rights will also check.  This is necessary in case the
    admin tightened up GL_WILDREPOS_PERM_CATS after someone had already
    setperms-d his repos.

  - as a bonus, we eliminate all the post-Dumper shenanigans, at least
    for READERS and WRITERS.  Those two now look, to the compile script,
    just like any other usernames.
2010-11-06 21:03:34 +05:30
..
keys finally, open up my secret test scripts... 2010-06-12 13:24:55 +05:30
out custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE) 2010-11-06 21:03:34 +05:30
basic.conf finally, open up my secret test scripts... 2010-06-12 13:24:55 +05:30
cleanout-gitolite finally, open up my secret test scripts... 2010-06-12 13:24:55 +05:30
install-gitolite finally, open up my secret test scripts... 2010-06-12 13:24:55 +05:30
README.mkd finally, open up my secret test scripts... 2010-06-12 13:24:55 +05:30
rollback gqt -- gitolite quick (re-)test 2010-08-09 23:21:14 +05:30
rollback.server gqt -- gitolite quick (re-)test 2010-08-09 23:21:14 +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 (minor) make time-style=long-iso explicit in t00 2010-08-21 10:47:47 +05:30
t01-repo-groups allow @groups in setperms command also 2010-08-21 13:04:13 +05:30
t02-user-groups allow @groups in setperms command also 2010-08-21 13:04:13 +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 lots of changes to tests for big-config 2010-08-11 22:38:16 +05:30
t04a-wild-students lots of changes to tests for big-config 2010-08-11 22:38:16 +05:30
t05-delegation (tests) added tests for delegating with wildcards 2010-08-21 10:48:39 +05:30
t05a-delegation test suite: catch internal errors better 2010-06-18 22:09:30 +05:30
t05b-delegation-wild (tests) added tests for delegating with wildcards 2010-08-21 10:48:39 +05:30
t09-oldtests finally, open up my secret test scripts... 2010-06-12 13:24:55 +05:30
t09a-oldtests darn... git 1.7+ puts out different messages on clone... 2010-07-23 17:06:47 +05:30
t50-sequence-test custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE) 2010-11-06 21:03:34 +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 info/expand print better(?) permission codes 2010-08-24 17:51:33 +05:30
t54-repo-configs lots of changes to tests for big-config 2010-08-11 22:38:16 +05:30
t55-repo-configs-wild-without-CREATOR lots of changes to tests for big-config 2010-08-11 22:38:16 +05:30
t56-repo-configs-wild-with-CREATOR new tests: t55 and t56 for repo config with wildrepos 2010-08-11 22:38:15 +05:30
t57-daemon-gitweb allow @all to also include gitweb and daemon 2010-08-24 21:38:46 +05:30
t58-daemon-gitweb-wild allow @all to also include gitweb and daemon 2010-08-24 21:38:46 +05:30
t59-repo-not-on-disk (tests) t59 to test previous commit... 2010-07-30 13:51:41 +05:30
t60-daemon-gitweb-via-setperms custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE) 2010-11-06 21:03:34 +05:30
t61-setperms-groups custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE) 2010-11-06 21:03:34 +05:30
t62-rule-sequences (tests) added t62 for 32056e0 2010-11-06 12:35:46 +05:30
t63-perm-cats custom perm categories in setperms (WARNING: PLEASE READ FULL COMMIT MESSAGE) 2010-11-06 21:03:34 +05:30
test-driver.sh (test driver) editrc function buglet 2010-11-06 12:35:46 +05:30
update-gitolite finally, open up my secret test scripts... 2010-06-12 13:24:55 +05:30

notes on the testing setup

In this document:

terminology

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

notes and background

  • all testing is done on one machine, using 2 userids

  • test driver exits on the first failed test; no fancy counting here. (PW).

  • installs are done using "gl-easy-install". As such, this test suite is mainly meant for testing the core (access control) functionality, and will not help you test the install/upgrade parts themselves. Those are a lot more difficult to test in an automated fashion, but luckily they also change infrequently and can easily be tested manually when they do. Errors in those are much more visible too. (PW).

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

quick instructions for running the test suite

  • create two brand new user IDs: tester and gitolite-test

    • these are hard-coded, sorry. (PW)
    • give them some passwords
    • allow ssh into gitolite-test in /etc/ssh/sshd_config; preferably use a line like AllowUsers gitolite-test@127.0.0.1 so that no one can ssh in from outside
  • prepare/push a bare clone of gitolite itself on /tmp so that the "tester" userid can grab it painlessly

    cd your-gitolite-working-repo
    git clone --bare $PWD /tmp/gitolite                 # first time
    git push -f --all /tmp/gitolite                     # subsequent times
    
  • "su" to "tester" and clone/fetch the gitolite source:

    cd $HOME; git clone /tmp/gitolite                   # first time
    cd gitolite; git fetch origin                       # subsequent times
    
  • checkout and "install" the branch you want to test (install from "tester" userid to "gitolite-test" userid). Example, if you want to test "pu" branch:

    git checkout -t origin/pu                           # if needed
    git checkout -f pu; git reset --hard origin/pu      # subsequent times
    cd t        # THIS IS IMPORTANT (patches welcome, or will be fixed eventually!)
    ./install-gitolite
    
  • run all or some of the tests

    ./test-driver.sh
    # or
    ./test-driver.sh t51
    

instructions for adding new tests

(TODO)