This commit is contained in:
butomo1989 2019-01-15 10:19:42 +01:00
parent 32cb68f6c9
commit cf0ebd7eb9
2 changed files with 4 additions and 2 deletions

View file

@ -124,7 +124,8 @@ def appium_run(avd_name: str):
grid_connect = convert_str_to_bool(str(os.getenv('CONNECT_TO_GRID', False))) grid_connect = convert_str_to_bool(str(os.getenv('CONNECT_TO_GRID', False)))
logger.info('Connect to selenium grid? {connect}'.format(connect=grid_connect)) logger.info('Connect to selenium grid? {connect}'.format(connect=grid_connect))
if grid_connect: if grid_connect:
local_ip = os.popen('ifconfig eth0 | grep \'inet addr:\' | cut -d: -f2 | awk \'{ print $1}\'').read().strip() # Ubuntu 16.04 -> local_ip = os.popen('ifconfig eth0 | grep \'inet addr:\' | cut -d: -f2 | awk \'{ print $1}\'').read().strip()
local_ip = os.popen('ifconfig eth0 | grep \'inet\' | cut -d: -f2 | awk \'{ print $2}\'').read().strip()
try: try:
mobile_web_test = convert_str_to_bool(str(os.getenv('MOBILE_WEB_TEST', False))) mobile_web_test = convert_str_to_bool(str(os.getenv('MOBILE_WEB_TEST', False)))
appium_host = os.getenv('APPIUM_HOST', local_ip) appium_host = os.getenv('APPIUM_HOST', local_ip)

View file

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
ip=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') #Ubuntu 16.04 -> ip=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
ip=$(ifconfig eth0 | grep 'inet' | cut -d: -f2 | awk '{ print $2}')
socat tcp-listen:5554,bind=$ip,fork tcp:127.0.0.1:5554 & socat tcp-listen:5554,bind=$ip,fork tcp:127.0.0.1:5554 &
socat tcp-listen:5555,bind=$ip,fork tcp:127.0.0.1:5555 socat tcp-listen:5555,bind=$ip,fork tcp:127.0.0.1:5555