summaryrefslogtreecommitdiffstats
path: root/src/fluent-bit/lib/librdkafka-2.1.0/packaging/rpm/tests/run-test.sh
blob: c1234a945f737fce7c706fe1e1c3b23816a4b752 (plain)
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
#!/bin/bash
#
# This script runs in the docker container, performing:
# * install build toolchain
# * install librdkafka rpms
# * builds test apps
# * runs test apps
#
# Usage: $0 <docker-image-name>

set -ex

pushd /v

_IMG=$1

echo "Testing on $_IMG"

if [[ $_IMG == "centos:6" ]]; then
    _EL=6
    _INST="yum install -y -q"
elif [[ $_IMG == "centos:7" ]]; then
    _EL=7
    _INST="yum install -y -q"
    # centos:7 ships with openssl-libs 1.0.1 which is outdated and not
    # ABI-compatible with 1.0.2 (which we build with).
    # Upgrade openssl-libs, as users would, to prevent missing symbols.
    _UPG="yum upgrade -y openssl-libs"
else
    _EL=8
    _INST="dnf install -y -q"
fi

$_INST gcc gcc-c++ make pkg-config

if [[ -n $_UPG ]]; then
    $_UPG
fi

$_INST /rpms/librdkafka1-*el${_EL}.x86_64.rpm /rpms/librdkafka-devel-*el${_EL}.x86_64.rpm

make clean all

make run

make clean

echo "$_IMG is all good!"