forked from gluster/gogfapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Starts a docker container with gluster server to do tests. It's based on https://github.com/src-d/go-billy-gluster Signed-off-by: Javi Fontan <jfontan@gmail.com>
- Loading branch information
Showing
2 changed files
with
40 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,23 @@ | ||
language: go | ||
|
||
go: | ||
- 1.11.x | ||
- 1.10.x | ||
|
||
go_import_path: github.com/gluster/gogfapi | ||
|
||
dist: xenial | ||
addons: | ||
apt: | ||
update: true | ||
packages: | ||
- glusterfs-common | ||
|
||
services: | ||
- docker | ||
|
||
before_script: | ||
- bash -x test_setup.sh | ||
|
||
script: | ||
- go test -v ./... |
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,17 @@ | ||
#!/bin/bash | ||
|
||
docker run -d --name gluster-test \ | ||
-p 24007:24007/tcp -p 24008:24008/tcp -p 24007:24007/udp -p 24008:24008/udp \ | ||
-p 49152:49152/tcp -p 49152:49152/udp -p 49153:49153/tcp -p 49154:49154/tcp \ | ||
-v /sys/fs/cgroup:/sys/fs/cgroup:ro --privileged=true \ | ||
gluster/gluster-centos:gluster4u0_centos7 | ||
|
||
# wait for glusterd service to be active | ||
while ! docker exec gluster-test systemctl is-active glusterd; do | ||
sleep 1 | ||
done | ||
|
||
docker exec gluster-test /bin/sh -c "echo '127.0.1.1 $(hostname)' >> /etc/hosts" | ||
docker exec gluster-test gluster volume create test $(hostname):/srv force | ||
docker exec gluster-test gluster volume set test storage.owner-uid $(id -u) | ||
docker exec gluster-test gluster volume start test |