-
Notifications
You must be signed in to change notification settings - Fork 351
/
suite.bats
executable file
·50 lines (38 loc) · 1.24 KB
/
suite.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
48
49
50
#!/usr/bin/env bats
@test "ruby version is 3.2" {
run docker run --rm $IMAGE sh -c "ruby --version | cut -d ' ' -f 2"
[ "$status" -eq 0 ]
major=$(echo "$output" | cut -d '.' -f 1)
minor=$(echo "$output" | cut -d '.' -f 2)
[ "$major" -eq "3" ]
[[ "$minor" -eq "2" ]]
}
@test "fluentd is installed" {
run docker run --rm $IMAGE which fluentd
[ "$status" -eq 0 ]
}
@test "fluentd runs ok" {
run docker run --rm $IMAGE fluentd --help
[ "$status" -eq 0 ]
}
@test "fluentd has correct version" {
run docker run --rm $IMAGE fluentd --version
[ "$status" -eq 0 ]
actual=$(echo "$output" | cut -d ' ' -f 2 | tr -d " \n")
run sh -c "cat Makefile | grep $DOCKERFILE: | cut -d ':' -f 2 \
| cut -d ',' -f 1 \
| cut -d '-' -f 1 \
| tr -d ' v'"
[ "$status" -eq 0 ]
[ "$output" != '' ]
expected="$output"
[ "$actual" == "$expected" ]
}
@test "gem 'oj' is installed " {
run docker run --rm $IMAGE sh -c "gem list --local oj | grep -e '^oj '"
[ "$status" -eq 0 ]
}
@test "gem 'json' is installed " {
run docker run --rm $IMAGE sh -c "gem list --local json | grep -e '^json '"
[ "$status" -eq 0 ]
}