Skip to content

Commit

Permalink
Merge pull request #498 from mackerelio/memcached-test-sh
Browse files Browse the repository at this point in the history
[ci]rewrite check-memcached tests. used docker.
  • Loading branch information
yseto authored Jun 18, 2021
2 parents 6b7af6e + e8554fb commit d65337a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 78 deletions.
78 changes: 0 additions & 78 deletions check-memcached/lib/check-memcached_test.go

This file was deleted.

26 changes: 26 additions & 0 deletions check-memcached/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/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")" || exit
PATH=$(pwd):$PATH
plugin=$(basename "$(pwd)")
if ! which "$plugin" >/dev/null
then
echo "$prog: $plugin is not installed" >&2
exit 2
fi

port=21211
image=memcached

docker run --name "test-$plugin" -p "$port:11211" -d "$image"
trap 'docker stop test-$plugin; docker rm test-$plugin; exit' EXIT
sleep 10

exec $plugin -p $port -k test

0 comments on commit d65337a

Please sign in to comment.