diff --git a/src/app.py b/src/app.py index 4d273ff..020a53b 100644 --- a/src/app.py +++ b/src/app.py @@ -124,7 +124,8 @@ def appium_run(avd_name: str): grid_connect = convert_str_to_bool(str(os.getenv('CONNECT_TO_GRID', False))) logger.info('Connect to selenium grid? {connect}'.format(connect=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: mobile_web_test = convert_str_to_bool(str(os.getenv('MOBILE_WEB_TEST', False))) appium_host = os.getenv('APPIUM_HOST', local_ip) diff --git a/src/port_forward.sh b/src/port_forward.sh index 2c5d8dd..0534c22 100644 --- a/src/port_forward.sh +++ b/src/port_forward.sh @@ -1,5 +1,6 @@ #!/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:5555,bind=$ip,fork tcp:127.0.0.1:5555