File tree Expand file tree Collapse file tree 2 files changed +86
-1
lines changed Expand file tree Collapse file tree 2 files changed +86
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ workflows:
20
20
version : ["2.0", "2.1", "2.2", "2.3"]
21
21
- publish_docker_images :
22
22
<< : *master_filter
23
+ - test-influxdb-binaries :
24
+ matrix :
25
+ parameters :
26
+ product : [ "influxdb/1.9/data", "influxdb/1.9/meta" ]
23
27
24
28
jobs :
25
29
build :
39
43
enum : ["2.0", "2.1", "2.2", "2.3"]
40
44
steps :
41
45
- checkout
42
- - run : sudo apt-get update && sudo apt-get install -y jq
46
+ - run : |
47
+ sudo apt-get update &&
48
+ sudo apt-get install -y jq
43
49
- run : bash influxdb/test/test-2x-e2e.sh << parameters.version >>
44
50
- store_artifacts :
45
51
path : influxdb/test/logs
74
80
name : Do Enterprise Release
75
81
command : |
76
82
.circleci/scripts/do-enterprise-release
83
+
84
+ test-influxdb-binaries :
85
+ machine : true
86
+ parameters :
87
+ product :
88
+ type : string
89
+ steps :
90
+ - checkout
91
+ - run :
92
+ name : Validate Docker Image Binaries
93
+ command : influxdb/test/test-binaries << parameters.product >>
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -o errexit \
3
+ -o nounset \
4
+ -o pipefail
5
+
6
+ function build_local_image()
7
+ {
8
+ # ${1} -> directory
9
+ # ${2} -> tag
10
+ pushd " ${1} "
11
+
12
+ docker build -t " ${2} " .
13
+
14
+ popd
15
+ }
16
+
17
+ # ${1} -> product
18
+ build_local_image " ${1} " " influxdb-test"
19
+
20
+ read -d ' ' -r PROGRAM << 'EOF ' || true
21
+ set -o errexit \
22
+ -o nounset \
23
+ -o pipefail \
24
+ -o xtrace
25
+
26
+ export DEBIAN_FRONTEND=noninteractive
27
+ apt-get update
28
+ apt-get install --yes binutils
29
+
30
+ function test_race()
31
+ {
32
+ # ${1} -> target
33
+ if grep --quiet 'WARNING\: DATA RACE' <<<"$(strings "${1}")"
34
+ then
35
+ printf 'Race-enabled binary detected: %s\n' "${1}" >&2 ; exit 1
36
+ fi
37
+ }
38
+
39
+ function test_static()
40
+ {
41
+ # ${1} -> target
42
+
43
+ # `ldd` has the disadavantage that it cannot differentiate between a binary
44
+ # without a dynamic section and garbage. `file` requires somewhat brittle
45
+ # string parsing. `readelf` + `grep` circumvents both of these problems.
46
+ if ! readelf --dynamic "${1}" | \
47
+ grep --silent 'There is no dynamic section in this file.'
48
+ then
49
+ printf 'Non-static binary detected: %s\n' "${1}" >&2 ; exit 1
50
+ fi
51
+ }
52
+
53
+ for target in \
54
+ /usr/bin/influx \
55
+ /usr/bin/influx_inspect \
56
+ /usr/bin/influxd \
57
+ /usr/bin/influxd-ctl \
58
+ /usr/bin/influxd-meta
59
+ do
60
+ if [[ -x "${target}" ]]
61
+ then
62
+ test_race "${target}"
63
+ test_static "${target}"
64
+ fi
65
+ done
66
+ EOF
67
+
68
+ docker run -it " influxdb-test" bash -c " ${PROGRAM} "
You can’t perform that action at this time.
0 commit comments