Skip to content

Commit

Permalink
update runner to Focal (#205)
Browse files Browse the repository at this point in the history
Co-authored-by: Florian Forster <[email protected]>
  • Loading branch information
braydonk and octo authored Aug 1, 2024
1 parent 4156eed commit ccc43fa
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 55 deletions.
122 changes: 70 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,36 @@ on: [push, pull_request]
name: Test
jobs:
test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
env:
CC: gcc
steps:
- run: |
sudo apt-get update && sudo apt-get install \
autotools-dev \
libatasmart-dev \
libcap-dev \
libcurl4-gnutls-dev \
libdbi0-dev \
libesmtp-dev \
libganglia1-dev \
libgcrypt20-dev \
libglib2.0-dev \
libgps-dev \
autoconf \
automake \
bison \
debhelper \
debian-keyring \
default-jdk \
devscripts \
flex \
gcc \
libcurl4-openssl-dev \
libhiredis-dev \
libi2c-dev \
libiptc-dev \
libldap2-dev \
libltdl-dev \
liblua50-dev \
liblua5.1-0-dev \
liblua5.2-dev \
libmemcached-dev \
libmicrohttpd-dev \
libmnl-dev \
libmodbus-dev \
libmongoc-dev \
libmosquitto-dev \
libmysqlclient-dev \
libnotify-dev \
libopenipmi-dev \
liboping-dev \
libow-dev \
libpcap-dev \
libperl-dev \
libpq-dev \
libprotobuf-c-dev \
librabbitmq-dev \
librdkafka-dev \
libriemann-client-dev \
librrd-dev \
libsensors4-dev \
libsigrok-dev \
libsnmp-dev \
libtokyocabinet-dev \
libtokyotyrant-dev \
libudev-dev \
libupsclient-dev \
libvarnish-dev \
libvirt-dev \
libxen-dev \
libxml2-dev \
libxtables-dev \
libssl-dev \
libtool \
libvarnishapi-dev \
libyajl-dev \
linux-libc-dev \
perl \
protobuf-c-compiler \
python3-dev \
python-dev \
xfslibs-dev
lsb-release \
make \
pkg-config \
python2-dev \
python3-dev
- uses: actions/checkout@v2
with:
submodules: true
Expand All @@ -72,7 +40,57 @@ jobs:
sh clean.sh
sh build.sh
autoreconf -vif
- run: ./configure --enable-debug
- run: |
./configure --disable-all-plugins \
--disable-static \
--disable-perl --without-libperl --without-perl-bindings \
--enable-cpu \
--enable-df \
--enable-disk \
--enable-load \
--enable-logfile \
--enable-logging-metrics \
--enable-memory \
--enable-swap \
--enable-syslog \
--enable-interface \
--enable-tcpconns \
--enable-write_http \
--enable-aggregation \
--enable-conntrack \
--enable-csv \
--enable-nginx \
--enable-apache \
--enable-memcached \
--enable-mysql \
--enable-protocols \
--enable-postgresql \
--enable-plugin_mem \
--enable-processes \
--enable-python \
--enable-python3 \
--enable-ntpd \
--enable-nfs \
--enable-zookeeper \
--enable-stackdriver_agent \
--enable-exec \
--enable-tail \
--enable-statsd \
--enable-network \
--enable-match_regex --enable-target_set \
--enable-target_replace --enable-target_scale \
--enable-match_throttle_metadata_keys \
--enable-write_log \
--enable-unixsock \
--enable-java --with-java=/usr/lib/jvm/default-java \
--enable-redis --with-libhiredis \
--enable-curl \
--enable-curl_json \
--enable-mongodb \
--enable-varnish \
--enable-write_gcm \
--enable-debug
# VERBOSE=1 dumps the contents of the test suites logs to standard output.
# -fsanitize=address enables https:/google/sanitizers/wiki/AddressSanitizer
# -ldl works around a dlsym error when tsan is enabled in this environment.
Expand Down
3 changes: 3 additions & 0 deletions src/daemon/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ int strjoin(char *buffer, size_t buffer_size, char **fields, size_t fields_num,
buffer_req += sep_len;
buffer_req += field_len;

if (buffer_size == 0)
continue;

if ((i != 0) && (sep_len > 0)) {
if (sep_len >= avail) {
/* prevent subsequent iterations from writing to the
Expand Down
8 changes: 5 additions & 3 deletions src/daemon/common_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,12 @@ DEF_TEST(strjoin) {
cases[i].fields_num, cases[i].separator);
EXPECT_EQ_INT(cases[i].want_return, status);
EXPECT_EQ_STR(cases[i].want_buffer, buffer);
}

/* use (NULL, 0) to determine required buffer size. */
EXPECT_EQ_INT(3, strjoin(NULL, 0, (char *[]){"a", "b"}, 2, "-"));
/* use (NULL, 0) to determine required buffer size. */
EXPECT_EQ_INT(cases[i].want_return,
strjoin(NULL, 0, cases[i].fields, cases[i].fields_num,
cases[i].separator));
}

return 0;
}
Expand Down

0 comments on commit ccc43fa

Please sign in to comment.