Compare commits
154 Commits
Author | SHA1 | Date |
---|---|---|
Raphael | 062d6419d6 | 4 months ago |
Erik Auerswald | 00d6417104 | 4 months ago |
Erik Auerswald | a1509c1b4d | 4 months ago |
Erik Auerswald | 54e6f838c3 | 4 months ago |
Erik Auerswald | d0ed64bcc7 | 4 months ago |
Erik Auerswald | ab20b150b8 | 4 months ago |
Erik Auerswald | 65f00ff013 | 4 months ago |
Erik Auerswald | a333f95c9d | 4 months ago |
German Service Network | 94de79153f | 5 months ago |
German Service Network | 118cdc5cc6 | 5 months ago |
German Service Network | b39f5a5cef | 5 months ago |
German Service Network | aa724910b8 | 5 months ago |
German Service Network | 85b92d3d21 | 5 months ago |
German Service Network | 652d319803 | 5 months ago |
German Service Network | 2f2ff0bd2c | 5 months ago |
German Service Network | 46793cdf80 | 5 months ago |
Erik Auerswald | 97b7484350 | 5 months ago |
Erik Auerswald | 79e274d4b8 | 5 months ago |
Eduard Vlad | 11a48b4de1 | 5 months ago |
Erik Auerswald | 90ad83fbd0 | 6 months ago |
dwes | 0d08321346 | 7 months ago |
German Service Network | bd44c9f016 | 7 months ago |
German Service Network | f71e40ab60 | 7 months ago |
German Service Network | 5a2a23d2af | 7 months ago |
German Service Network | 47c0c3d8de | 7 months ago |
David Schweikert | ab05279782 | 7 months ago |
David Schweikert | d6d9c653eb | 7 months ago |
German Service Network | 94e98acaaa | 7 months ago |
Erik Auerswald | c3a2f2c7cc | 9 months ago |
Erik Auerswald | 4151976986 | 9 months ago |
Erik Auerswald | 266eb16568 | 9 months ago |
Erik Auerswald | c138b08141 | 9 months ago |
Erik Auerswald | ae0bc23804 | 9 months ago |
Erik Auerswald | 1443614dad | 9 months ago |
Erik Auerswald | c122186f70 | 9 months ago |
Erik Auerswald | d312a278d5 | 9 months ago |
Erik Auerswald | ef74f642d1 | 9 months ago |
Erik Auerswald | 32b9a55a98 | 9 months ago |
Erik Auerswald | dcda0cc595 | 9 months ago |
Erik Auerswald | c5428391a6 | 9 months ago |
Erik Auerswald | 8ae2babae0 | 9 months ago |
Erik Auerswald | 290d944b56 | 9 months ago |
Erik Auerswald | e4bae43d66 | 9 months ago |
Erik Auerswald | 2a609b856d | 10 months ago |
Erik Auerswald | 3a527fbc86 | 10 months ago |
Erik Auerswald | 4753437b17 | 10 months ago |
Erik Auerswald | ccc0cdfdd7 | 10 months ago |
Erik Auerswald | 2fa4f61079 | 10 months ago |
deepkv | c8e9632150 | 10 months ago |
German Service Network | a3f4c573bf | 1 year ago |
German Service Network | 7351afdd89 | 1 year ago |
German Service Network | 163fcdb1ed | 1 year ago |
German Service Network | b8e413f5ba | 1 year ago |
German Service Network | 88091f7c94 | 1 year ago |
darless | 8601d1ba70 | 1 year ago |
darless1 | e20939ebfe | 1 year ago |
darless1 | 55ad83898f | 1 year ago |
German Service Network | 59f32cefb2 | 1 year ago |
ilyam8 | a6c314516c | 1 year ago |
ilyam8 | 16108c4fa7 | 1 year ago |
ilyam8 | d95370cbb0 | 1 year ago |
Vincent OLLIVIER | 86dedacbe7 | 1 year ago |
Khem Raj | c0fbccb977 | 1 year ago |
German Service Network | f94adaf29e | 1 year ago |
German Service Network | d45438c723 | 1 year ago |
German Service Network | e597c48d77 | 1 year ago |
German Service Network | 9d7731e7a0 | 1 year ago |
German Service Network | e8660637cc | 1 year ago |
David Schweikert | 8dc0b7f39a | 2 years ago |
David Schweikert | 041ba7acb8 | 2 years ago |
Thomas Klausner | 5d3eee1105 | 3 years ago |
David Schweikert | ab1ed993ba | 3 years ago |
David Schweikert | e975a4339b | 3 years ago |
David Schweikert | 87c9b29d86 | 3 years ago |
David Schweikert | ae49f4d933 | 3 years ago |
Erik Auerswald | c67f6deb51 | 3 years ago |
German Service Network | 948b58ee1f | 3 years ago |
David Schweikert | 3ecfbb7c1e | 3 years ago |
David Schweikert | 2d574aa1d1 | 3 years ago |
David Schweikert | 052b58be65 | 3 years ago |
Erik Auerswald | 36b652b358 | 3 years ago |
Erik Auerswald | 1452bf362e | 3 years ago |
David Schweikert | 477e6776ce | 3 years ago |
David Schweikert | cbe7a92c14 | 3 years ago |
David Schweikert | bbaa365526 | 3 years ago |
David Schweikert | cf03fa5bdb | 3 years ago |
David Schweikert | f1d3615706 | 3 years ago |
German Service Network | 04af04c839 | 3 years ago |
David Schweikert | 749127f525 | 3 years ago |
David Schweikert | 03aea81617 | 3 years ago |
David Schweikert | df5f072ddd | 3 years ago |
David Schweikert | 7b3cf2593a | 3 years ago |
David Schweikert | ca3cf3a347 | 3 years ago |
Yiran Zhou | 029da075e2 | 3 years ago |
David Schweikert | 19ddae8fdc | 3 years ago |
German Service Network | ea0eda41f1 | 3 years ago |
aafbsd | bbe847a5d9 | 3 years ago |
David Schweikert | b4aeda17fd | 3 years ago |
Konstantin Shalygin | b46c161bb3 | 3 years ago |
David Schweikert | d05a7e7bf9 | 3 years ago |
Norman Rasmussen | e432f46e01 | 4 years ago |
Tim Gates | 95df9d00f5 | 4 years ago |
David Schweikert | eac20347ba | 4 years ago |
David Schweikert | 49673f7862 | 4 years ago |
David Schweikert | ce9d6b351e | 4 years ago |
Henrique de Moraes Holschuh | 59d83ed402 | 4 years ago |
Dirk Meyer | 31f76f6071 | 4 years ago |
German Service Network | f2b2cdf620 | 4 years ago |
David Schweikert | 296de3d7a2 | 4 years ago |
David Schweikert | 03bfc48ff4 | 4 years ago |
David Schweikert | 5f5220939d | 4 years ago |
David Schweikert | f6e3d7194d | 4 years ago |
David Schweikert | 57d49f2d8e | 4 years ago |
David Schweikert | 2ca8edeaf6 | 4 years ago |
David Schweikert | 0d8f3cef2a | 4 years ago |
David Schweikert | aeea60a0e0 | 4 years ago |
David Schweikert | 5a6a61cb32 | 4 years ago |
David Schweikert | 4f16eea49f | 4 years ago |
David Schweikert | 2dbe46f936 | 4 years ago |
David Schweikert | 363396c28f | 4 years ago |
David Schweikert | 88ef7a7b98 | 4 years ago |
David Schweikert | 73bfc121c2 | 4 years ago |
David Schweikert | d06b8fcea3 | 4 years ago |
David Schweikert | 5655b7664c | 4 years ago |
David Schweikert | 3bb2811139 | 4 years ago |
David Schweikert | 2f71a6a701 | 4 years ago |
David Schweikert | 9682f3e49d | 4 years ago |
David Schweikert | a136764f8c | 4 years ago |
David Schweikert | 43f6e3498e | 4 years ago |
David Schweikert | 130b1d6f9b | 4 years ago |
David Schweikert | fec099871c | 4 years ago |
David Schweikert | da27697eb4 | 4 years ago |
David Schweikert | fe4388ca3d | 4 years ago |
David Schweikert | eb87a2affd | 4 years ago |
David Schweikert | 5473c7d734 | 4 years ago |
David Schweikert | ac3eb34ad7 | 4 years ago |
David Schweikert | 2cb373463f | 4 years ago |
David Schweikert | 6505832d6a | 4 years ago |
David van Leusen | 254573f241 | 4 years ago |
David van Leusen | 69f7277076 | 4 years ago |
David Schweikert | 2b5c0e62ec | 4 years ago |
David Schweikert | bb8d71ef27 | 4 years ago |
Steven Noonan | 6600b04152 | 4 years ago |
David Schweikert | 8152668607 | 4 years ago |
David Schweikert | c7437d8f61 | 4 years ago |
Lars Wendler | 54e97d9e39 | 4 years ago |
David Schweikert | 08c83453f3 | 4 years ago |
David Schweikert | 9731556633 | 4 years ago |
David Schweikert | c1d3f65694 | 4 years ago |
David Schweikert | 721af135db | 4 years ago |
Steven Noonan | ad451e7a15 | 4 years ago |
Steven Noonan | 754a21e2bd | 4 years ago |
Steven Noonan | 8aa4361118 | 4 years ago |
Steven Noonan | e21b68f62e | 4 years ago |
@ -0,0 +1,30 @@
|
|||||||
|
.*.swp
|
||||||
|
*.tar.gz
|
||||||
|
*~
|
||||||
|
src/*.gcno
|
||||||
|
src/*.gcda
|
||||||
|
src/*.gcov
|
||||||
|
src/tags
|
||||||
|
.deps
|
||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
aclocal.m4
|
||||||
|
autom4te.cache
|
||||||
|
compile
|
||||||
|
config.guess
|
||||||
|
config.h
|
||||||
|
config.h.in
|
||||||
|
config.log
|
||||||
|
config.status
|
||||||
|
config.sub
|
||||||
|
configure
|
||||||
|
depcomp
|
||||||
|
install-sh
|
||||||
|
missing
|
||||||
|
src/*.o
|
||||||
|
src/fping
|
||||||
|
src/fping6
|
||||||
|
stamp-h1
|
||||||
|
doc/fping.8
|
||||||
|
doc/fping6.8
|
||||||
|
ci/build
|
@ -0,0 +1,108 @@
|
|||||||
|
name: Test
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
Test-Linux:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-20.04, ubuntu-22.04]
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install libcap2-bin libtest-command-perl lcov
|
||||||
|
sudo sysctl net.ipv4.ping_group_range='0 2147483647'
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
ci/build-1-autotools.sh
|
||||||
|
ci/build-4-compile.sh
|
||||||
|
ci/test-tarball.sh
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
PATH=`pwd`/src:$PATH
|
||||||
|
# avoid pinging internet hosts because it doesn't
|
||||||
|
# work with GitHub Actions being hosted in Azure.
|
||||||
|
prove $(ls ci/test-*.pl|grep -v internet-hosts)
|
||||||
|
ci/run-lcov.sh
|
||||||
|
|
||||||
|
- name: Coveralls
|
||||||
|
uses: coverallsapp/github-action@master
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
path-to-lcov: lcov.info
|
||||||
|
flag-name: ${{ matrix.os }}
|
||||||
|
parallel: true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test-Mac:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
brew install automake lcov
|
||||||
|
ci/build-2-test-command.sh
|
||||||
|
ci/build-3-prepare-macos.sh
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
ci/build-4-compile.sh
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
PATH=`pwd`/src:$PATH
|
||||||
|
export SKIP_IPV6=1
|
||||||
|
prove $(ls ci/test-*.pl|grep -v internet-hosts)
|
||||||
|
ci/run-lcov.sh
|
||||||
|
|
||||||
|
- name: Coveralls
|
||||||
|
uses: coverallsapp/github-action@master
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
path-to-lcov: lcov.info
|
||||||
|
flag-name: macos
|
||||||
|
parallel: true
|
||||||
|
|
||||||
|
Coveralls-Finish:
|
||||||
|
needs: [Test-Linux, Test-Mac]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Coveralls
|
||||||
|
uses: coverallsapp/github-action@master
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
parallel-finished: true
|
||||||
|
|
||||||
|
Release-Tarball:
|
||||||
|
needs: [Test-Linux, Test-Mac]
|
||||||
|
if: ${{ github.event_name == 'push' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install libcap2-bin libtest-command-perl
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
ci/build-1-autotools.sh
|
||||||
|
ci/build-4-compile.sh
|
||||||
|
ci/test-tarball.sh
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: fping-*.tar.gz
|
@ -1,40 +1,98 @@
|
|||||||
# travis-ci.org configuration
|
|
||||||
#
|
|
||||||
language: generic
|
language: generic
|
||||||
sudo: required
|
|
||||||
dist: trusty
|
os:
|
||||||
|
- linux
|
||||||
|
|
||||||
|
dist:
|
||||||
|
- trusty
|
||||||
|
- xenial
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- secure: "CoI8hwHH1yfQoQxIfWGRS0WfTyScox+5aJn0fDDgz2uKrrIxmBvIw/WKX8wcSiV6fLmLuwgNkKqSM3hdO4qaG+JxfWcuEiZZHm+kxSGMkWbGb/fvAI+gHg8ldKyYttcIX71O5rlZiC2QpNKQi2v18S6pI5p8eqnx7DYx4YrmguQ="
|
- secure: "CoI8hwHH1yfQoQxIfWGRS0WfTyScox+5aJn0fDDgz2uKrrIxmBvIw/WKX8wcSiV6fLmLuwgNkKqSM3hdO4qaG+JxfWcuEiZZHm+kxSGMkWbGb/fvAI+gHg8ldKyYttcIX71O5rlZiC2QpNKQi2v18S6pI5p8eqnx7DYx4YrmguQ="
|
||||||
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
|
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
|
||||||
# via the "travis encrypt" command using the project repo's public key
|
# via the "travis encrypt" command using the project repo's public key
|
||||||
- secure: "C9ZJ9LYnuowRdF4D66KLfquimvu8GtRGIafwvCcGYKReEy8phlBdFsHlybkMBNYJNTJSM0j6wyo1lKTVGHxmpQDimjR7kmxUtawbhuJ5qOCBtFqNVh9lRQi7hC4+UOhvRsIcbV8HAJM5u/5RxGOfXCePK3a2DtiYv1d2NHToZN8="
|
- secure: "C9ZJ9LYnuowRdF4D66KLfquimvu8GtRGIafwvCcGYKReEy8phlBdFsHlybkMBNYJNTJSM0j6wyo1lKTVGHxmpQDimjR7kmxUtawbhuJ5qOCBtFqNVh9lRQi7hC4+UOhvRsIcbV8HAJM5u/5RxGOfXCePK3a2DtiYv1d2NHToZN8="
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
webhooks: https://coveralls.io/webhook
|
||||||
|
|
||||||
compiler:
|
compiler:
|
||||||
- gcc
|
- gcc
|
||||||
before_install:
|
|
||||||
- sudo apt-get update -qq
|
addons:
|
||||||
- sudo apt-get install libcap2-bin
|
apt:
|
||||||
#- sudo apt-get install traceroute
|
update: true
|
||||||
#- traceroute google.com
|
packages:
|
||||||
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
|
- libcap2-bin
|
||||||
install:
|
- libtest-command-perl
|
||||||
- ci/build-1-autotools.sh
|
|
||||||
- curl -L http://cpanmin.us | perl - --sudo App::cpanminus
|
|
||||||
- cpanm --sudo Test::Command
|
|
||||||
script:
|
script:
|
||||||
- ci/build-2-install.sh
|
- ci/build-4-compile.sh
|
||||||
- env PATH=`pwd`/src:$PATH prove ci/test-*.pl
|
- ci/run-tests.sh
|
||||||
- ci/test-tarball.sh
|
|
||||||
after_success:
|
after_success:
|
||||||
- ci/coveralls.sh
|
- ci/deploy-coveralls.sh
|
||||||
- ci/deploy-bintray.sh
|
|
||||||
|
|
||||||
addons:
|
stages:
|
||||||
coverity_scan:
|
- test
|
||||||
project:
|
- name: deploy
|
||||||
name: "schweikert/fping"
|
if: branch = master OR branch = v4.x
|
||||||
description: "Build submitted via Travis CI"
|
- name: coverity
|
||||||
notification_email: david@schweikert.ch
|
if: branch = master OR branch = coverity_scan
|
||||||
#build_command_prepend: "ci/build-2-install.sh"
|
|
||||||
build_command: "ci/build-2-install.sh"
|
jobs:
|
||||||
branch_pattern: coverity_scan
|
include:
|
||||||
|
#### STAGE: test
|
||||||
|
- stage: test
|
||||||
|
name: test trusty
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
env:
|
||||||
|
- SKIP_IPV6=1
|
||||||
|
install:
|
||||||
|
- ci/build-1-autotools.sh
|
||||||
|
|
||||||
|
- name: test xenial
|
||||||
|
os: linux
|
||||||
|
dist: xenial
|
||||||
|
env:
|
||||||
|
- SKIP_IPV6=1
|
||||||
|
|
||||||
|
- name: test bionic
|
||||||
|
os: linux
|
||||||
|
dist: bionic
|
||||||
|
env:
|
||||||
|
- SKIP_IPV6=1
|
||||||
|
|
||||||
|
- name: test bionic lxd arm64
|
||||||
|
os: linux
|
||||||
|
dist: bionic
|
||||||
|
arch: arm64
|
||||||
|
|
||||||
|
- name: test macos
|
||||||
|
os: osx
|
||||||
|
install:
|
||||||
|
- ci/build-2-test-command.sh
|
||||||
|
- ci/build-3-prepare-macos.sh
|
||||||
|
env:
|
||||||
|
- SKIP_IPV6=1
|
||||||
|
|
||||||
|
#### STAGE: deploy
|
||||||
|
- stage: deploy
|
||||||
|
name: deploy
|
||||||
|
os: linux
|
||||||
|
dist: xenial
|
||||||
|
env:
|
||||||
|
- SKIP_IPV6=1
|
||||||
|
after_success:
|
||||||
|
- ci/deploy-bintray.sh
|
||||||
|
|
||||||
|
#### STAGE: coverity
|
||||||
|
- stage: coverity
|
||||||
|
name: coverity
|
||||||
|
os: linux
|
||||||
|
dist: xenial
|
||||||
|
after_success:
|
||||||
|
script:
|
||||||
|
- ci/deploy-coverity.sh
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Debug fping",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/src/fping",
|
||||||
|
"args": ["127.0.0.1"],
|
||||||
|
"stopAtEntry": false,
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"environment": [],
|
||||||
|
"externalConsole": false,
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Set Disassembly Flavor to Intel",
|
||||||
|
"text": "-gdb-set disassembly-flavor intel",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"preLaunchTask": "build",
|
||||||
|
"postDebugTask": "autoclean",
|
||||||
|
"miDebuggerPath": "/usr/bin/gdb",
|
||||||
|
"logging": {
|
||||||
|
"engineLogging": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": "2.0.0"
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "autogen",
|
||||||
|
"command": "./autogen.sh",
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "configure",
|
||||||
|
"command": "./configure",
|
||||||
|
"args": ["--enable-debug"],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"dependsOn": ["autogen"],
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "build",
|
||||||
|
"command": "make",
|
||||||
|
"args": ["CFLAGS=\"-g -O0\""],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"dependsOn": ["configure"],
|
||||||
|
"problemMatcher": ["$gcc"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "autoclean",
|
||||||
|
"command": "./autoclean.sh",
|
||||||
|
"problemMatcher": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": "2.0.0"
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
curl -L http://cpanmin.us | perl - -L $HOME/perl5 App::cpanminus
|
||||||
|
$HOME/perl5/bin/cpanm --sudo Test::Command
|
@ -1,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
sudo -H pip install cpp-coveralls
|
|
||||||
|
|
||||||
cd src
|
|
||||||
|
|
||||||
ls -l
|
|
||||||
|
|
||||||
gcov *.o
|
|
||||||
cd ..
|
|
||||||
coveralls --exclude ci --exclude src/optparse.c --no-gcov
|
|
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
if [ "$TRAVIS_DIST" = "trusty" ]; then
|
||||||
|
echo "skip coveralls on trusty because coveralls errors out due to python issues"
|
||||||
|
exit 0
|
||||||
|
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||||
|
pip3 install --user cpp-coveralls
|
||||||
|
PATH="${PATH}:$(python3 -c 'import site; print(site.USER_BASE)')/bin"
|
||||||
|
else
|
||||||
|
pip install --user cpp-coveralls
|
||||||
|
fi
|
||||||
|
|
||||||
|
export COVERALLS_PARALLEL=true
|
||||||
|
coveralls --build-root src --exclude src/optparse.c --exclude ci --exclude config.h --gcov-options '\-lp'
|
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
COVERITY_SCAN_PROJECT_NAME=schweikert/fping
|
||||||
|
COVERITY_SCAN_EMAIL=david@schweikert.ch
|
||||||
|
|
||||||
|
if [ -z "$COVERITY_SCAN_TOKEN" ]; then
|
||||||
|
echo "ERROR: COVERITY_SCAN_TOKEN not defined." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl -o /tmp/cov-analysis-linux64.tgz https://scan.coverity.com/download/linux64 \
|
||||||
|
--form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN
|
||||||
|
tar xfz /tmp/cov-analysis-linux64.tgz
|
||||||
|
./autogen.sh
|
||||||
|
./configure --enable-ipv4 --enable-ipv6 --enable-safe-limits --prefix=/opt/fping
|
||||||
|
cov-analysis-linux64-*/bin/cov-build --dir cov-int make -j4
|
||||||
|
tar cfz cov-int.tar.gz cov-int
|
||||||
|
curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME \
|
||||||
|
--form token=$COVERITY_SCAN_TOKEN \
|
||||||
|
--form email=$COVERITY_SCAN_EMAIL \
|
||||||
|
--form file=@cov-int.tar.gz \
|
||||||
|
--form version="`git rev-parse --short HEAD`" \
|
||||||
|
--form description="`git rev-parse --short HEAD` / $TRAVIS_BUILD_ID "
|
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
lcov -c -no-external \
|
||||||
|
-d . \
|
||||||
|
-b src \
|
||||||
|
-o lcov-all.info
|
||||||
|
|
||||||
|
lcov --remove lcov-all.info -o lcov.info \
|
||||||
|
'*/optparse.c'
|
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
PATH=`pwd`/src:$PATH
|
||||||
|
|
||||||
|
prove ci/test-*.pl
|
||||||
|
ci/test-tarball.sh
|
@ -1,43 +0,0 @@
|
|||||||
#!/usr/bin/perl -w
|
|
||||||
|
|
||||||
use English;
|
|
||||||
use Test::Command;
|
|
||||||
use Test::More;
|
|
||||||
|
|
||||||
if( $^O eq 'darwin' ) {
|
|
||||||
plan skip_all => 'Test irrelevant on MacOS';
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub get_ping_gid_range {
|
|
||||||
open FD, "/proc/sys/net/ipv4/ping_group_range" or return undef;
|
|
||||||
chomp(my $line = <FD>);
|
|
||||||
my @range = split(/\s+/, $line);
|
|
||||||
close FD;
|
|
||||||
return @range;
|
|
||||||
}
|
|
||||||
|
|
||||||
my @gids = split(' ', $EGID);
|
|
||||||
my @allowed_gid_range = get_ping_gid_range();
|
|
||||||
|
|
||||||
# Linux test for unprivileged ping support
|
|
||||||
foreach(@gids) {
|
|
||||||
if ($_ >= $allowed_gid_range[0] && $_ <= $allowed_gid_range[1]) {
|
|
||||||
plan skip_all => "Userspace pings are allowed, gid $_ in range [$allowed_gid_range[0], $allowed_gid_range[1]]";
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
plan tests => 3;
|
|
||||||
|
|
||||||
# run without privileges
|
|
||||||
my $fping_bin = `which fping`; chomp $fping_bin;
|
|
||||||
system("cp $fping_bin /tmp/fping.copy; chmod +x /tmp/fping.copy");
|
|
||||||
|
|
||||||
# fping
|
|
||||||
{
|
|
||||||
my $cmd = Test::Command->new(cmd => "/tmp/fping.copy 127.0.0.1");
|
|
||||||
$cmd->exit_is_num(4);
|
|
||||||
$cmd->stdout_is_eq("");
|
|
||||||
$cmd->stderr_like(qr{: can't create socket \(must run as root\?\)});
|
|
||||||
}
|
|
@ -0,0 +1,57 @@
|
|||||||
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
|
use English;
|
||||||
|
use Test::Command;
|
||||||
|
use Test::More;
|
||||||
|
|
||||||
|
if( $^O eq 'darwin' ) {
|
||||||
|
plan skip_all => 'Test irrelevant on MacOS';
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub get_ping_gid_range {
|
||||||
|
open FD, "/proc/sys/net/ipv4/ping_group_range" or return undef;
|
||||||
|
chomp(my $line = <FD>);
|
||||||
|
my @range = split(/\s+/, $line);
|
||||||
|
close FD;
|
||||||
|
return @range;
|
||||||
|
}
|
||||||
|
|
||||||
|
my @gids = split(' ', $EGID);
|
||||||
|
my @allowed = get_ping_gid_range();
|
||||||
|
|
||||||
|
# Make a copy of the binary so that we get rid of setuid bit
|
||||||
|
my $fping_bin = `which fping`; chomp $fping_bin;
|
||||||
|
system("cp $fping_bin /tmp/fping.copy; chmod +x /tmp/fping.copy");
|
||||||
|
|
||||||
|
# Determine what test to run, based on whether unprivileged
|
||||||
|
# pings are allowed.
|
||||||
|
if(scalar grep { $_ >= $allowed[0] && $_ <= $allowed[1] } @gids) {
|
||||||
|
diag('test unprivileged mode');
|
||||||
|
test_unprivileged_works();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
test_privileged_fails();
|
||||||
|
}
|
||||||
|
|
||||||
|
sub test_unprivileged_works {
|
||||||
|
plan tests => 3;
|
||||||
|
|
||||||
|
{
|
||||||
|
my $cmd = Test::Command->new(cmd => "fping 127.0.0.1");
|
||||||
|
$cmd->exit_is_num(0);
|
||||||
|
$cmd->stdout_is_eq("127.0.0.1 is alive\n");
|
||||||
|
$cmd->stderr_is_eq("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub test_privileged_fails {
|
||||||
|
plan tests => 3;
|
||||||
|
|
||||||
|
{
|
||||||
|
my $cmd = Test::Command->new(cmd => "/tmp/fping.copy 127.0.0.1");
|
||||||
|
$cmd->exit_is_num(4);
|
||||||
|
$cmd->stdout_is_eq("");
|
||||||
|
$cmd->stderr_like(qr{: can't create socket \(must run as root\?\)});
|
||||||
|
}
|
||||||
|
}
|
@ -1,10 +1,27 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
use Test::Command tests => 33;
|
use Test::Command tests => 84;
|
||||||
|
use Test::More;
|
||||||
|
|
||||||
for my $arg (qw(b B c C H i O p Q r t)) {
|
# some options require a numeric argument
|
||||||
my $cmd = Test::Command->new(cmd => "fping -$arg xxx");
|
for my $arg (qw(b B c C H i O p Q r t x X)) {
|
||||||
$cmd->exit_is_num(1);
|
for my $test_input (qw(xxx '')) {
|
||||||
$cmd->stdout_is_eq("");
|
my $cmd = Test::Command->new(cmd => "fping -$arg $test_input");
|
||||||
$cmd->stderr_like(qr{Usage:});
|
$cmd->exit_is_num(1);
|
||||||
|
$cmd->stdout_is_eq("");
|
||||||
|
$cmd->stderr_like(qr{Usage:});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# fping -k, only supported on Linux, requires a number
|
||||||
|
SKIP: {
|
||||||
|
if($^O ne 'linux') {
|
||||||
|
skip '-k option is only supported on Linux', 6;
|
||||||
|
}
|
||||||
|
for my $test_input (qw(xxx '')) {
|
||||||
|
my $cmd = Test::Command->new(cmd => "fping -k $test_input 127.0.0.1");
|
||||||
|
$cmd->exit_is_num(1);
|
||||||
|
$cmd->stdout_is_eq("");
|
||||||
|
$cmd->stderr_like(qr{Usage:});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
FROM ubuntu:20.04
|
||||||
|
|
||||||
|
# Base
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
build-essential \
|
||||||
|
automake \
|
||||||
|
m4
|
||||||
|
|
||||||
|
# Add source code
|
||||||
|
COPY ./ /app
|
||||||
|
|
||||||
|
# Compile
|
||||||
|
WORKDIR /app
|
||||||
|
RUN autoreconf --install
|
||||||
|
RUN ./configure && make && make install
|
||||||
|
ENTRYPOINT ["fping"]
|
@ -1,2 +1,3 @@
|
|||||||
BasedOnStyle: WebKit
|
BasedOnStyle: WebKit
|
||||||
BreakBeforeBraces: Stroustrup
|
BreakBeforeBraces: Stroustrup
|
||||||
|
PointerAlignment: Right
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue