ssh-basic tests (and that's all we will ever do; see below)
ssh tests are meant to ensure that basic authENTICATION is happening. AuthORISATION is checked all over the rest of the test suite and these two are quite orthogonal operations so there is no need to test all of authZ with ssh.
This commit is contained in:
parent
141b2ce897
commit
4e25a8acd1
16 changed files with 267 additions and 0 deletions
51
t/ssh-basic.t
Executable file
51
t/ssh-basic.t
Executable file
|
@ -0,0 +1,51 @@
|
|||
#!/usr/bin/perl
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
# this is hardcoded; change it if needed
|
||||
use lib "src";
|
||||
use Gitolite::Common;
|
||||
use Gitolite::Test;
|
||||
|
||||
my $bd = `gitolite query-rc -n GL_BINDIR`;
|
||||
my $h = $ENV{HOME};
|
||||
my $ab = `gitolite query-rc -n GL_ADMIN_BASE`;
|
||||
umask 0077;
|
||||
|
||||
try "
|
||||
plan 26
|
||||
|
||||
# reset stuff
|
||||
rm -f $h/.ssh/authorized_keys; ok or die 1
|
||||
|
||||
cp $bd/../t/keys/u[1-6]* $h/.ssh; ok or die 2
|
||||
cp $bd/../t/keys/admin* $h/.ssh; ok or die 3
|
||||
cp $bd/../t/keys/config $h/.ssh; ok or die 4
|
||||
|
||||
mkdir $ab/keydir; ok or die 5
|
||||
cp $bd/../t/keys/*.pub $ab/keydir; ok or die 6
|
||||
";
|
||||
|
||||
_system("gitolite post-compile ssh-authkeys");
|
||||
|
||||
# basic tests
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
confreset; confadd '
|
||||
@g1 = u1
|
||||
@g2 = u2
|
||||
repo foo
|
||||
RW = @g1 u3
|
||||
R = @g2 u4
|
||||
';
|
||||
|
||||
try "ADMIN_PUSH set3; !/FATAL/" or die text();
|
||||
|
||||
try "
|
||||
ssh u1 info; ok; /R W \tfoo/
|
||||
ssh u2 info; ok; /R \tfoo/
|
||||
ssh u3 info; ok; /R W \tfoo/
|
||||
ssh u4 info; ok; /R \tfoo/
|
||||
ssh u5 info; ok; !/foo/
|
||||
ssh u6 info; ok; !/foo/
|
||||
"
|
Loading…
Add table
Add a link
Reference in a new issue