forked from buildkite/elastic-ci-stack-for-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
goss.yaml
210 lines (166 loc) · 4.16 KB
/
goss.yaml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
file:
/etc/buildkite-agent/buildkite-agent.cfg:
exists: true
/etc/buildkite-agent/hooks:
filetype: directory
exists: true
owner: buildkite-agent
group: buildkite-agent
/etc/systemd/system/refresh_authorized_keys.service:
exists: true
/etc/systemd/system/refresh_authorized_keys.timer:
exists: true
/home/ec2-user/.ssh/authorized_keys:
exists: true
contains: ["!packer"]
/root/.ssh/authorized_keys:
exists: true
contains: ["!packer"]
/var/lib/buildkite-agent/builds:
filetype: directory
exists: true
owner: buildkite-agent
group: buildkite-agent
/var/lib/buildkite-agent/plugins:
filetype: directory
exists: true
owner: buildkite-agent
group: buildkite-agent
/usr/local/bin/stop-agent-gracefully:
exists: true
mode: "0755"
port:
tcp:22:
listening: true
ip:
- 0.0.0.0
tcp6:22:
listening: true
ip:
- '::'
service:
amazon-cloudwatch-agent:
enabled: true
running: true
amazon-ssm-agent:
enabled: true
running: true
docker:
enabled: true
running: true
lifecycled:
enabled: true
running: true
sshd:
enabled: true
running: true
buildkite-agent:
enabled: true
running: true
user:
buildkite-agent:
exists: true
uid: 2000
gid: 2000
groups:
- buildkite-agent
- docker
home: /var/lib/buildkite-agent
shell: /bin/bash
sshd:
exists: true
uid: 74
gid: 74
groups:
- sshd
home: /usr/share/empty.sshd
shell: /sbin/nologin
group:
buildkite-agent:
exists: true
gid: 2000
docker:
exists: true
gid: 993
sshd:
exists: true
gid: 74
process:
buildkite-agent:
running: true
lifecycled:
running: true
sshd:
running: true
command:
aws --version:
exit-status: 0
curl --version:
exit-status: 0
dig -h:
exit-status: 0
git --version:
exit-status: 0
git-lfs --version:
exit-status: 0
command -v lsof:
exit-status: 0
make --version:
exit-status: 0
wget --version:
exit-status: 0
# Check refresh authorized keys gear is present, but disabled.
# disabled: The unit file is not enabled, but contains an [Install] section with installation instructions.
systemctl is-enabled refresh_authorized_keys.timer:
exit-status: 1
stdout:
- /disabled/
systemctl is-enabled docker-gc.timer:
exit-status: 0
/usr/local/bin/docker-gc:
exit-status: 0
systemctl is-enabled docker-low-disk-gc.timer:
exit-status: 0
/usr/local/bin/docker-low-disk-gc:
exit-status: 0
# test that we can build a docker image
docker buildx build -f tests/Dockerfile --progress=plain -t buildkite-postgres:latest tests:
exit-status: 0
timeout: 60000
# Check docker userns is enabled
# Note that goss will evaluate the outer layer of templating, and docker will evaluate the second
# Running `goss validate --format documentation` will print this with the first layer of templating evaluated
'{{ `docker info --format=",{{range .SecurityOptions}}{{.}},{{end}}"` }}':
exit-status: 0
timeout: 30000
stdout:
- /,name=userns,/
# Check docker plugins are installed
# Note that goss will evaluate the first layer of templating, and docker will evaluate the second
# Running `goss validate --format documentation` will print this with the first layer of templating evaluated
'{{ `docker info --format=",{{range .ClientInfo.Plugins}}{{.Name}},{{end}}"` }}':
exit-status: 0
timeout: 30000
stdout:
- /,buildx,/
- /,compose,/
# Check that docker containers can run
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock docker:latest version:
exit-status: 0
timeout: 60000
# Check that userns allows writing as buildkite-agent
sh -c 'docker run --rm -v "$PWD:/pwd" alpine:latest touch /pwd/test && stat -c %U:%G test' && rm test:
exit-status: 0
timeout: 30000
stdout:
- buildkite-agent:docker
docker run --rm -t arm64v8/ubuntu uname -m:
exit-status: 0
timeout: 30000
stdout:
- aarch64
docker run --rm -t amd64/ubuntu uname -m:
exit-status: 0
timeout: 30000
stdout:
- x86_64