Skip to content

Commit

Permalink
Apply CI workaround and re-enable ping tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 27, 2025
1 parent 28f53ed commit 7a04492
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ jobs:
run: |
sudo apt update
sudo apt install -y libxml2-dev libxslt-dev
- name: Enable unprivileged ping sockets
# actions/runner-images#11614
if: matrix.platform == 'ubuntu-latest'
shell: bash
run: |
echo 'net.ipv4.ping_group_range = 0 2147483647' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
- name: Setup Python
uses: actions/setup-python@v4
with:
Expand All @@ -85,6 +92,13 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Enable unprivileged ping sockets
# actions/runner-images#11614
if: matrix.platform == 'ubuntu-latest'
shell: bash
run: |
echo 'net.ipv4.ping_group_range = 0 2147483647' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
- name: Setup Python
uses: actions/setup-python@v4
with:
Expand Down
17 changes: 1 addition & 16 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,6 @@ def old_ping_exception():
return sys.version_info < (3, 10)


def broken_actions_runner():
"""
Is unprivileged ICMP unavailable?
Since Dec 2024, GitHub Actions runners no longer seem
to be able to allow unprivileged ICMP.
actions/runner-images#11614
"""
return bool(os.environ.get('GITHUB_ACTIONS')) and (
# Unfortunately, `os.environ['RUNNER_OS']` doesn't work
platform.system() == 'Linux'
)


collect_ignore = (
[
'jaraco/net/devices/linux.py',
Expand All @@ -55,7 +40,7 @@ def broken_actions_runner():
+ [
'jaraco/net/icmp.py',
]
* (old_ping_exception() or broken_actions_runner())
* old_ping_exception()
)


Expand Down

0 comments on commit 7a04492

Please sign in to comment.