Skip to content

Commit

Permalink
edge-testnet - add detection for ICMP packet block cases
Browse files Browse the repository at this point in the history
If we have 100% packet loss on www.google.com we can assume
ICMP has been blocked.
  • Loading branch information
JanneKiiskila committed Jan 24, 2024
1 parent 81dec60 commit 1744a2a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:
group: pe-utils-'${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
run-shellcheck:
run-shellcheck-and-scripts:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
Expand All @@ -15,9 +15,6 @@ jobs:
run: shellcheck fw-tools/edge-testnet
- name: Run edge-testnet
run: |
ping -h | true
ping -q -c 1 bootstrap.us-east-1.mbedcloud.com
ping -q -c 1 lwm2m.us-east-1.mbedcloud.com
fw-tools/edge-testnet -e
- run: shellcheck edge-info/edge-info
- run: cat /etc/os-release
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
1. [fw-tools] - Check return code of `openssl` calls.
1. [fw-tools] - Return non-zero exit code if any failures spotted.
1. [fw-tools] - Skip L4 / netcat tests if BusyBox `nc` is detected (as it does not support DNS queries).
1. [fw-tools] - Skip L3 / ping tests if 100% packet loss encountered with google.com. ICMP traffic is then most likely blocked.

## Izuma Edge utilities 2.3.2
1. [fw-tools] - add `tcp-lwm2m.mbedcloud.com` address to be tested.
Expand Down
7 changes: 6 additions & 1 deletion fw-tools/edge-testnet
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,12 @@ test_L4() {
}

main() {
test_L3
pinggoogle=$(ping -q -c 1 google.com 2>&1)
if [[ "$pinggoogle" =~ "100% packet loss" ]]; then
echo "ICMP traffic blocked, skipping L3 (ping) tests."
else
test_L3
fi
busyboxnc=$(nc 2>&1)
if [[ "$busyboxnc" =~ "BusyBox" ]]; then
echo "BusyBox netcat detected, skipping Layer 4 tests"
Expand Down

0 comments on commit 1744a2a

Please sign in to comment.