Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
goatherd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
arw
goatherd
Commits
2063866c
Commit
2063866c
authored
7 years ago
by
Lukas Braun
Browse files
Options
Downloads
Patches
Plain Diff
Fixes for building with pbuilder
Also make sure tests don't fail if a goatherd instance is running on the build host.
parent
7999230d
No related branches found
Branches containing commit
Tags
v0.3
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test_pam_goatherd.sh
+8
-5
8 additions, 5 deletions
test_pam_goatherd.sh
test_pg.sh
+1
-1
1 addition, 1 deletion
test_pg.sh
with
9 additions
and
6 deletions
test_pam_goatherd.sh
+
8
−
5
View file @
2063866c
...
@@ -10,7 +10,7 @@ export PGHOST="$PWD/pg_pam_test"
...
@@ -10,7 +10,7 @@ export PGHOST="$PWD/pg_pam_test"
cleanup
()
{
cleanup
()
{
start_pg_cleanup
start_pg_cleanup
pkill goatherd
pkill
-u
$USER
goatherd
}
}
trap
'cleanup'
EXIT INT
trap
'cleanup'
EXIT INT
...
@@ -35,12 +35,15 @@ for i in $(seq 1 3); do
...
@@ -35,12 +35,15 @@ for i in $(seq 1 3); do
ghdb
$i
init-db
ghdb
$i
init-db
done
done
servicedir
=
$PWD
/test_pam_goatherd_services
mkdir
-p
$servicedir
echo
echo
echo
=====
Tests
=====
echo
=====
Tests
=====
echo
==
Single server tests
==
echo
==
Single server tests
==
echo
auth requisite
$PWD
/pam_goatherd.so
certs
=
test.crt
server
=
localhost:99
9
9
>
$
PWD
/test_pam_goatherd_
service
s
/single_server
echo
auth requisite
$PWD
/pam_goatherd.so
certs
=
test.crt
server
=
localhost:99
8
9
>
$service
dir
/single_server
echo
blub |
if
pw pamtester single_server someuser authenticate
;
then
echo
blub |
if
pw pamtester single_server someuser authenticate
;
then
die
"FAIL: Auth succeeded but no server is running"
die
"FAIL: Auth succeeded but no server is running"
...
@@ -48,7 +51,7 @@ else
...
@@ -48,7 +51,7 @@ else
echo
"(failure expected)"
echo
"(failure expected)"
fi
fi
ghdb 1 serve
-addr
127.0.0.1:99
9
9
-tls-key
test.key
-tls-cert
test.crt &
ghdb 1 serve
-addr
127.0.0.1:99
8
9
-tls-key
test.key
-tls-cert
test.crt &
echo
blub |
if
pw pamtester single_server someuser authenticate
;
then
echo
blub |
if
pw pamtester single_server someuser authenticate
;
then
die
"FAIL: Auth succeeded but user is not valid"
die
"FAIL: Auth succeeded but user is not valid"
...
@@ -74,7 +77,7 @@ fi
...
@@ -74,7 +77,7 @@ fi
echo
echo
echo
"== Multi server tests =="
echo
"== Multi server tests =="
echo
auth requisite
$PWD
/pam_goatherd.so
certs
=
test.crt
server
=
localhost:99
9
9
server
=
localhost:99
9
8
server
=
localhost:99
9
7
>
$
PWD
/test_pam_goatherd_
service
s
/three_servers
echo
auth requisite
$PWD
/pam_goatherd.so
certs
=
test.crt
server
=
localhost:99
8
9
server
=
localhost:99
8
8
server
=
localhost:99
8
7
>
$service
dir
/three_servers
oathtool
-d
8
-c
2
$(
echo
-n
$secret
| xxd
-p
)
|
\
oathtool
-d
8
-c
2
$(
echo
-n
$secret
| xxd
-p
)
|
\
if
pw pamtester three_servers someuser authenticate
;
then
if
pw pamtester three_servers someuser authenticate
;
then
...
@@ -83,7 +86,7 @@ else
...
@@ -83,7 +86,7 @@ else
echo
"(failure expected)"
echo
"(failure expected)"
fi
fi
ghdb 2 serve
-addr
127.0.0.1:99
9
8
-tls-key
test.key
-tls-cert
test.crt &
ghdb 2 serve
-addr
127.0.0.1:99
8
8
-tls-key
test.key
-tls-cert
test.crt &
oathtool
-d
8
-c
2
$(
echo
-n
$secret
| xxd
-p
)
|
\
oathtool
-d
8
-c
2
$(
echo
-n
$secret
| xxd
-p
)
|
\
if
pw pamtester three_servers someuser authenticate
;
then
if
pw pamtester three_servers someuser authenticate
;
then
...
...
This diff is collapsed.
Click to expand it.
test_pg.sh
+
1
−
1
View file @
2063866c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
set
-eu
set
-eu
go
test
-c
&
go
test
-c
-o
./goatherd.test
&
PGHOST
=
"
$PWD
/postgres_test"
PGHOST
=
"
$PWD
/postgres_test"
if
[
$#
-ge
1
]
;
then
if
[
$#
-ge
1
]
;
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment