2011-11-06 15:35:15 +01:00
|
|
|
# F=t_ notes on the testing setup
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
**WARNING: PLEASE use a dedicated user for doing this**. Various files and
|
|
|
|
directories get overwritten and it's much simpler this way.
|
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
## terminology
|
2010-06-12 07:33:53 +02:00
|
|
|
|
|
|
|
#define PW "patches welcome!"
|
|
|
|
#define TODO PW
|
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
## notes and background
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
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.
|
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
## playing with gitolite
|
2011-10-11 08:59:57 +02:00
|
|
|
|
|
|
|
(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...)
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
* Now log in as this user (doesn't matter how), and run the following
|
|
|
|
commands:
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
cd $HOME # if not already in $HOME
|
|
|
|
git clone git://github.com/sitaramc/gitolite
|
|
|
|
gitolite/t/install
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
This installs the "testbed" in the userid you chose. No other user is
|
|
|
|
affected in any way.
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
This is what you get when you do this:
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
* 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.
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
* 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.
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
* 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).
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
* The rest of a gitolite installation, such as the rc file in `~/.gitolite.rc` etc.
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
Don't forget that the client and the server are all on the same user on the
|
|
|
|
same machine.
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
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.
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
## testing gitolite
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
First, do what the "playing with gitolite" section says. That is a
|
|
|
|
pre-requisite.
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
Once that is done, run this command (still in `$HOME` of the gl-test userid):
|
2010-06-12 07:33:53 +02:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
prove gitolite/t/test-driver.sh
|
2011-01-15 16:39:56 +01:00
|
|
|
|
2011-10-11 08:59:57 +02:00
|
|
|
(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)
|
2011-01-15 16:39:56 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
## instructions for adding new tests
|
2010-06-12 07:33:53 +02:00
|
|
|
|
|
|
|
(TODO)
|
|
|
|
|