summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-05-31 12:38:49 +0100
committerSteve Sakoman <steve@sakoman.com>2024-10-10 12:01:06 -0700
commit78fc4af7770ed3c98e1617d9d47b106b405d55d6 (patch)
tree3fe5148606c2d4d03f9933de1879a9b6013018bc
parent689b521a38d9e04ae9d3debb27223e449de122a5 (diff)
downloadpoky-78fc4af7770ed3c98e1617d9d47b106b405d55d6.tar.gz
bitbake: tests/fetch: Tweak to work on Fedora40
On Fedora40, "localhost" sometimes resolves to ::1 and sometimes to 127.0.0.1 and python only binds to one of the addresses, leading to test failures. Use 127.0.0.1 explicitly to avoid problems of the name resolution, we're trying to test things other than the host networking. (Bitbake rev: 3147ebb0edcca8f7f850aabd86ef010ab593496f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9adc6da42618f41bf0d6b558d62b2f3c13bedd61) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--bitbake/lib/bb/tests/fetch.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index a7d9d5e887..efe5479a66 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -1417,7 +1417,7 @@ class FetchLatestVersionTest(FetcherTest):
1417 1417
1418 def test_wget_latest_versionstring(self): 1418 def test_wget_latest_versionstring(self):
1419 testdata = os.path.dirname(os.path.abspath(__file__)) + "/fetch-testdata" 1419 testdata = os.path.dirname(os.path.abspath(__file__)) + "/fetch-testdata"
1420 server = HTTPService(testdata) 1420 server = HTTPService(testdata, host="127.0.0.1")
1421 server.start() 1421 server.start()
1422 port = server.port 1422 port = server.port
1423 try: 1423 try:
@@ -1425,10 +1425,10 @@ class FetchLatestVersionTest(FetcherTest):
1425 self.d.setVar("PN", k[0]) 1425 self.d.setVar("PN", k[0])
1426 checkuri = "" 1426 checkuri = ""
1427 if k[2]: 1427 if k[2]:
1428 checkuri = "http://localhost:%s/" % port + k[2] 1428 checkuri = "http://127.0.0.1:%s/" % port + k[2]
1429 self.d.setVar("UPSTREAM_CHECK_URI", checkuri) 1429 self.d.setVar("UPSTREAM_CHECK_URI", checkuri)
1430 self.d.setVar("UPSTREAM_CHECK_REGEX", k[3]) 1430 self.d.setVar("UPSTREAM_CHECK_REGEX", k[3])
1431 url = "http://localhost:%s/" % port + k[1] 1431 url = "http://127.0.0.1:%s/" % port + k[1]
1432 ud = bb.fetch2.FetchData(url, self.d) 1432 ud = bb.fetch2.FetchData(url, self.d)
1433 pupver = ud.method.latest_versionstring(ud, self.d) 1433 pupver = ud.method.latest_versionstring(ud, self.d)
1434 verstring = pupver[0] 1434 verstring = pupver[0]