File tree Expand file tree Collapse file tree 3 files changed +29
-12
lines changed Expand file tree Collapse file tree 3 files changed +29
-12
lines changed Original file line number Diff line number Diff line change @@ -228,18 +228,13 @@ def get_access_url(app):
228
228
access_protocol = "https" if ssl_context else "http"
229
229
230
230
# When host interface is set to 0.0.0.0, in a windows system, the server will not be accessible.
231
- # Setting the value to fqdn , will allow it be remotely and locally accessible.
231
+ # Setting the value to 127.0.0.1 , will allow it be remotely and locally accessible.
232
232
233
233
# NOTE: When windows container support is introduced this will need to be tweaked accordingly.
234
234
if host_interface == "0.0.0.0" and system .is_windows ():
235
- import socket
235
+ host_interface = "127.0.0.1"
236
236
237
- hostname = socket .gethostname ()
238
- fqdn = socket .getfqdn (hostname )
239
-
240
- url = f"{ access_protocol } ://{ fqdn } :{ port } { base_url } "
241
- else :
242
- url = f"{ access_protocol } ://{ host_interface } :{ port } { base_url } "
237
+ url = f"{ access_protocol } ://{ host_interface } :{ port } { base_url } "
243
238
244
239
return url
245
240
Original file line number Diff line number Diff line change @@ -104,7 +104,10 @@ async def get_state(mwi_server_url, headers=None):
104
104
105
105
if not resp ["messages" ]["PingResponse" ][0 ]["messageFaults" ]:
106
106
return "up"
107
- except Exception :
107
+ except Exception as err :
108
+ logger .debug (
109
+ f"{ err } : Embbeded connector is currently not responding to ping requests."
110
+ )
108
111
pass
109
112
110
113
return "down"
Original file line number Diff line number Diff line change 2
2
3
3
import asyncio
4
4
import json
5
+ import platform
5
6
import time
6
7
import datetime
7
8
@@ -657,9 +658,27 @@ def non_default_host_interface_fixture(monkeypatch):
657
658
# First set the default host interface to a non-default value
658
659
# Then set MWI_TEST to false and then create an instance of the test_server
659
660
# This order will set the test_server with appropriate values.
660
- def test_get_access_url_non_dev (non_default_host_interface , non_test_env , test_server ):
661
- """Test to check access url to not be 127.0.0.1 in non-dev mode"""
662
- assert "127.0.0.1" not in util .get_access_url (test_server .app )
661
+
662
+
663
+ @pytest .mark .skipif (
664
+ platform .system () == "Linux" or platform .system () == "Darwin" ,
665
+ reason = "Testing the windows access URL" ,
666
+ )
667
+ def test_get_access_url_non_dev_windows (
668
+ non_default_host_interface , non_test_env , test_server
669
+ ):
670
+ """Test to check access url to be 127.0.0.1 in non-dev mode on Windows"""
671
+ assert "127.0.0.1" in util .get_access_url (test_server .app )
672
+
673
+
674
+ @pytest .mark .skipif (
675
+ platform .system () == "Windows" , reason = "Testing the non-Windows access URL"
676
+ )
677
+ def test_get_access_url_non_dev_posix (
678
+ non_default_host_interface , non_test_env , test_server
679
+ ):
680
+ """Test to check access url to be 0.0.0.0 in non-dev mode on Linux/Darwin"""
681
+ assert "0.0.0.0" in util .get_access_url (test_server .app )
663
682
664
683
665
684
@pytest .fixture (name = "set_licensing_info_mock_fetch_single_entitlement" )
You can’t perform that action at this time.
0 commit comments