/
test_gliderlabs_alpine-edge.bats
47 lines (40 loc) · 1.16 KB
/
test_gliderlabs_alpine-edge.bats
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
setup() {
docker history gliderlabs/alpine:edge >/dev/null 2>&1
}
@test "version is correct" {
run docker run gliderlabs/alpine:edge cat /etc/os-release
[ $status -eq 0 ]
case "${lines[2]}" in
VERSION_ID=3.12*) true;;
*) false;;
esac
}
@test "package installs cleanly" {
run docker run gliderlabs/alpine:edge apk add --update-cache openssl
[ $status -eq 0 ]
}
@test "timezone" {
run docker run gliderlabs/alpine:edge date +%Z
[ $status -eq 0 ]
[ "$output" = "UTC" ]
}
@test "apk-install script should be available" {
run docker run gliderlabs/alpine:edge which apk-install
[ $status -eq 0 ]
}
@test "repository list is correct" {
run docker run gliderlabs/alpine:edge cat /etc/apk/repositories
[ $status -eq 0 ]
[ "${lines[0]}" = "http://alpine.gliderlabs.com/alpine/edge/main" ]
[ "${lines[1]}" = "http://alpine.gliderlabs.com/alpine/edge/community" ]
[ "${lines[2]}" = "" ]
}
@test "cache is empty" {
run docker run gliderlabs/alpine:edge sh -c "ls -1 /var/cache/apk | wc -l"
[ $status -eq 0 ]
[ "$output" = "0" ]
}
@test "root password is disabled" {
run docker run --user nobody gliderlabs/alpine:edge su
[ $status -eq 1 ]
}