5 # this is hardcoded; change it if needed
9 # testing the (separate) authkeys handler
10 # ----------------------------------------------------------------------
12 $ENV{GL_BINDIR
} = "$ENV{PWD}/src";
14 my $ak = "$ENV{HOME}/.ssh/authorized_keys";
15 mkdir("$ENV{HOME}/.ssh", 0700) if not -d
"$ENV{HOME}/.ssh";
16 my $kd = `gitolite query-rc -n GL_ADMIN_BASE` . "/keydir";
20 my $pgm = "gitolite ../triggers/post-compile/ssh-authkeys";
29 $pgm; ok; /authorized_keys missing/
31 wc < $ak; ok; /2 *6 *32/
33 ssh-keygen -N '' -q -f alice -C alice
34 ssh-keygen -N '' -q -f bob -C bob
35 ssh-keygen -N '' -q -f carol -C carol
36 ssh-keygen -N '' -q -f dave -C dave
37 ssh-keygen -N '' -q -f eve -C eve
38 rm alice bob carol dave eve
39 ls -a; ok; /alice.pub/; /bob.pub/; /carol.pub/; /dave.pub/; /eve.pub/
41 wc < $ak; ok; /^ *7 .*/;
42 grep gitolite $ak; ok; /start/
47 cat carol.pub >> $ak; ok
48 $pgm; ok; /carol.pub duplicates.*non-gitolite key/
49 wc < $ak; ok; /^ *8 .*/;
51 # moving normal keys up
55 grep -n dave $ak; ok; /8:ssh-rsa/
57 $pgm; ok; /carol.pub duplicates.*non-gitolite key/
58 /dave.pub duplicates.*non-gitolite key/
59 grep -n dave $ak; ok; /3:ssh-rsa/
63 $pgm; !ok; /fingerprinting failed for \\'keydir/bad.pub\\'/
64 wc < $ak; ok; /^ *9 .*/;
65 # a good key doesn't get added
66 ssh-keygen -N '' -q -f good
67 $pgm; !ok; /fingerprinting failed for \\'keydir/bad.pub\\'/
68 wc < $ak; ok; /^ *9 .*/;
69 # till the bad key is removed
72 wc < $ak; ok; /^ *10 .*/;
76 $pgm; ok; /robert.pub duplicates.*bob.pub/