-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #348 from lufia/add-docs
Add documents for testing
- Loading branch information
Showing
6 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# How to check the plugin | ||
|
||
## Steps | ||
|
||
* Run the plugin standalone | ||
* Check the exit code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
prog=$(basename $0) | ||
cd $(dirname $0) | ||
plugin=$(basename $(pwd)) | ||
if ! which -s $plugin | ||
then | ||
echo "$prog: $plugin is not installed" >&2 | ||
exit 2 | ||
fi | ||
|
||
if $plugin >/dev/null 2>&1; then | ||
echo OK | ||
else | ||
echo FAIL | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# How to check the plugin | ||
|
||
## Requirements | ||
|
||
* dockerd | ||
|
||
## Steps | ||
|
||
* Run osixia/docker-openldap | ||
* Run the plugin standalone | ||
* Check the exit code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
|
||
prog=$(basename $0) | ||
if ! [[ -S /var/run/docker.sock ]] | ||
then | ||
echo "$prog: there are no running docker" >&2 | ||
exit 2 | ||
fi | ||
|
||
cd $(dirname $0) | ||
plugin=$(basename $(pwd)) | ||
if ! which -s $plugin | ||
then | ||
echo "$prog: $plugin is not installed" >&2 | ||
exit 2 | ||
fi | ||
|
||
# By default, LDAP_DOMAIN=example.org and LDAP_ORGANISATION=Example Inc | ||
docker run --name test-$plugin -p 389:389 -d \ | ||
-e 'LDAP_ADMIN_PASSWORD=passpass' \ | ||
osixia/openldap | ||
trap 'docker stop test-$plugin; docker rm test-$plugin; exit' EXIT | ||
sleep 10 | ||
|
||
base_dn='dc=example,dc=org' | ||
if $plugin -D "cn=admin,$base_dn" -P passpass -b "$base_dn" -c 2 -w 1 | ||
then | ||
echo OK | ||
else | ||
echo FAIL | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# How to check the plugin | ||
|
||
## Requirements | ||
|
||
* dockerd | ||
|
||
## Steps | ||
|
||
* Run redis:5 | ||
* Run the plugin standalone | ||
* Check the exit code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
prog=$(basename $0) | ||
if ! [[ -S /var/run/docker.sock ]] | ||
then | ||
echo "$prog: there are no running docker" >&2 | ||
exit 2 | ||
fi | ||
|
||
cd $(dirname $0) | ||
plugin=$(basename $(pwd)) | ||
if ! which -s $plugin | ||
then | ||
echo "$prog: $plugin is not installed" >&2 | ||
exit 2 | ||
fi | ||
|
||
docker run --name test-$plugin -p 16379:6379 -d redis:5 --requirepass passpass | ||
trap 'docker stop test-$plugin; docker rm test-$plugin; exit' EXIT | ||
sleep 10 | ||
|
||
if $plugin reachable --port 16379 --password passpass >/dev/null 2>&1 | ||
then | ||
echo OK | ||
else | ||
echo FAIL | ||
fi |