-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4623166
commit 9649eb4
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Testing Issue 8649 | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test-macos: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ 'macos-12', 'macos-13', 'macos-14'] | ||
try: ['0', '1', '2'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Configure Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: python.socket (before) | ||
shell: python | ||
run: | | ||
print( | ||
'Linux: Expecting gethostname to return the same as "hostname"' | ||
' and the other interfaces to return the same as "hostname -f"' | ||
'\n\n' | ||
'Mac OS: Expect *ipv6.arpa addresses due to a longstanding' | ||
' Python bug\n\n' | ||
) | ||
import socket | ||
for expr in ( | ||
'socket.gethostname()', | ||
'socket.getfqdn()', | ||
'socket.getfqdn(socket.gethostname())', | ||
'socket.getfqdn(socket.getfqdn())', | ||
'socket.gethostbyname_ex(socket.gethostname())[0]', | ||
'socket.gethostbyname_ex(socket.getfqdn())[0]' | ||
): | ||
try: | ||
result = eval(expr) | ||
except Exception as exc: | ||
result = str(exc) | ||
print(f'{expr:50}: {result}') | ||
- name: Get value of /etc/hosts | ||
run: | | ||
sudo cat /etc/hosts |