Skip to content

Commit 47b2b79

Browse files
authored
Patch to fix ptest issue in python-google-auth-oauthlib (#16473)
1 parent 49f6468 commit 47b2b79

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From d5fdae993da87ef29f37af71db1e0d7e5c124e6c Mon Sep 17 00:00:00 2001
2+
From: Aninda <v-anipradhan@microsoft.com>
3+
Date: Thu, 2 Apr 2026 16:34:19 -0400
4+
Subject: [PATCH] One of the ptest was failing for python-google-auth-oauthlib for arm64 architecture
5+
Failure Description: socket.gaierror: [Errno -2] Name or service not known when resolving socket.gethostbyname(socket.gethostname()).
6+
Fix for host name resolution for local IP issue on core-arm64 during ptest
7+
8+
---
9+
tests/unit/test_flow.py | 6 +++++-
10+
1 file changed, 5 insertions(+), 1 deletion(-)
11+
12+
diff --git a/tests/unit/test_flow.py b/tests/unit/test_flow.py
13+
index d9c9f8b..9df45e0 100644
14+
--- a/tests/unit/test_flow.py
15+
+++ b/tests/unit/test_flow.py
16+
@@ -380,8 +380,12 @@ class TestInstalledAppFlow(object):
17+
return mock.Mock()
18+
19+
make_server_mock.side_effect = assign_last_request_uri
20+
+
21+
+ try:
22+
+ my_ip = socket.gethostbyname(socket.gethostname())
23+
+ except socket.gaierror:
24+
+ my_ip = "127.0.0.1"
25+
26+
- my_ip = socket.gethostbyname(socket.gethostname())
27+
instance.run_local_server(bind_addr=my_ip, host="localhost")
28+
29+
assert webbrowser_mock.open.called
30+
--
31+
2.34.1
32+

SPECS/python-google-auth-oauthlib/python-google-auth-oauthlib.spec

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
Summary: Google oAuth Authentication Library
44
Name: python-%{pypi_name}
55
Version: 1.0.0
6-
Release: 1%{?dist}
6+
Release: 2%{?dist}
77
License: ASL 2.0
88
Vendor: Microsoft Corporation
99
Distribution: Azure Linux
1010
URL: https://github.com/googleapis/google-auth-library-python-oauthlib
1111
Source0: https://files.pythonhosted.org/packages/e3/b4/ef2170c5f6aa5bc2461bab959a84e56d2819ce26662b50038d2d0602223e/%{pypi_name}-%{version}.tar.gz
12+
Patch0: 0001-Fix-ptest-host-name-resolution-for-local-IP-issue.patch
1213
BuildRequires: python3-click
1314
BuildRequires: python3-devel
1415
BuildRequires: python3-google-auth
@@ -32,7 +33,7 @@ Summary: %{summary}
3233
This library provides oauthlib integration with google-auth.
3334

3435
%prep
35-
%autosetup -n %{pypi_name}-%{version}
36+
%autosetup -n %{pypi_name}-%{version} -p1
3637
rm -rf %{pypi_name}.egg-info
3738

3839
%build
@@ -53,6 +54,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} pytest -v tests
5354
%{python3_sitelib}/google_auth_oauthlib-%{version}-py%{python3_version}.egg-info
5455

5556
%changelog
57+
* Thu Apr 02 2026 Aninda Pradhan <v-anipradhan@microsoft.com> - 1.0.0-2
58+
- patch to fix ptest host name resolution for local IP issue
59+
5660
* Thu Nov 02 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 1.0.0-1
5761
- Auto-upgrade to 1.0.0 - Azure Linux 3.0 - package upgrades
5862

0 commit comments

Comments
 (0)