Skip to content

Commit a1bd2f8

Browse files
committed
Add Goss test suite for testing the generated docker images
These are for use with Goss @ https://github.com/aelsabbahy/goss, or rather `dgoss` which is the wrapper for testing Docker containers. The `goss_wait.yaml` file is used to wait for the Gitblit process to have started so that testing all ports and HTTP requests can be done. Thanks go to @nicholaswilde for making Goss known to me.
1 parent cfd130a commit a1bd2f8

File tree

2 files changed

+155
-0
lines changed

2 files changed

+155
-0
lines changed

goss.yaml

+141
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
file:
2+
/usr/local/bin/docker-entrypoint.sh:
3+
filetype: file
4+
exists: true
5+
mode: "0755"
6+
size: 5094
7+
owner: root
8+
group: root
9+
10+
/var/opt/gitblit/etc:
11+
filetype: directory
12+
exists: true
13+
mode: "6775"
14+
owner: gitblit
15+
group: gitblit
16+
17+
/opt/gitblit/data:
18+
filetype: symlink
19+
exists: true
20+
linked-to: /var/opt/gitblit/etc
21+
22+
/var/opt/gitblit/srv:
23+
filetype: directory
24+
exists: true
25+
mode: "6775"
26+
owner: gitblit
27+
group: gitblit
28+
29+
/opt/gitblit/data/git:
30+
filetype: symlink
31+
exists: true
32+
linked-to: /var/opt/gitblit/srv/git
33+
34+
/opt/gitblit/etc/system.properties:
35+
filetype: file
36+
exists: true
37+
mode: "0644"
38+
size: 345
39+
owner: root
40+
group: root
41+
42+
/var/opt/gitblit/etc/gitblit-docker.properties:
43+
filetype: file
44+
exists: true
45+
mode: "0664"
46+
owner: gitblit
47+
group: gitblit
48+
contains:
49+
- "include = /opt/gitblit/etc/defaults.properties,/opt/gitblit/etc/system.properties"
50+
51+
/var/opt/gitblit/etc/gitblit.properties:
52+
filetype: file
53+
exists: true
54+
mode: "0664"
55+
owner: gitblit
56+
group: gitblit
57+
contains:
58+
- "include = gitblit-docker.properties"
59+
60+
# Check container log if the Gitblit output reached the follwing lines
61+
# and has no warnings or errors.
62+
/goss/docker_output.log:
63+
exists: true
64+
contains:
65+
- "All managers started"
66+
- "Started Wicket"
67+
- "!Failed"
68+
69+
70+
user:
71+
gitblit:
72+
exists: true
73+
uid: 8117
74+
gid: 8117
75+
groups:
76+
- gitblit
77+
home: /opt/gitblit
78+
79+
80+
group:
81+
gitblit:
82+
exists: true
83+
gid: 8117
84+
85+
86+
mount:
87+
/var/opt/gitblit:
88+
exists: true
89+
opts:
90+
- rw
91+
- relatime
92+
93+
94+
process:
95+
java:
96+
running: true
97+
98+
99+
port:
100+
tcp:8080:
101+
listening: true
102+
ip:
103+
- 0.0.0.0
104+
tcp:8081:
105+
listening: true
106+
ip:
107+
- 127.0.0.1
108+
tcp:8443:
109+
listening: true
110+
ip:
111+
- 0.0.0.0
112+
tcp:9418:
113+
listening: true
114+
ip:
115+
- 0.0.0.0
116+
tcp:29418:
117+
listening: true
118+
ip:
119+
- 0.0.0.0
120+
121+
122+
http:
123+
https://localhost:8443:
124+
status: 200
125+
allow-insecure: true
126+
no-follow-redirects: true
127+
timeout: 5000
128+
body:
129+
- "<title>Gitblit</title>"
130+
- "<h2>Welcome to Gitblit</h2>"
131+
132+
http://localhost:8080:
133+
status: 200
134+
allow-insecure: true
135+
no-follow-redirects: false
136+
timeout: 5000
137+
body:
138+
- "<title>Gitblit</title>"
139+
- "<h2>Welcome to Gitblit</h2>"
140+
141+

goss_wait.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
port:
2+
tcp:8080:
3+
listening: true
4+
ip:
5+
- 0.0.0.0
6+
tcp:8081:
7+
listening: true
8+
ip:
9+
- 127.0.0.1
10+
11+
12+
process:
13+
java:
14+
running: true

0 commit comments

Comments
 (0)