-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-test.sh
executable file
·45 lines (40 loc) · 1.15 KB
/
docker-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
#
# docker-test.sh
#
# Copyright (c) 2017 Junpei Kawamoto
#
# This file is part of cgss.
#
# cgss is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cgss is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cgss. If not, see <http://www.gnu.org/licenses/>.
#
#
# Run docker based client/server tests.
#
docker run -d --name cgss-server -p 13009:13009 itslabq/cgss
cat << EOS > cgss.yml
groups:
- name: Group1
servers:
- address: 127.0.0.1
port: 13009
EOS
cd client
go build -o client
cd ../
./client/client remote put cgss.yml 1 1
./client/client remote get cgss.yml --output cgss2.yml
docker kill cgss-server
docker rm cgss-server
[[ -z $(diff cgss.yml cgss2.yml && rm cgss.yml cgss2.yml) ]]