diff --git a/roles/devices/templates/mcloud-devices.txt b/roles/devices/templates/mcloud-devices.txt index 9d1b303..e1f034f 100644 --- a/roles/devices/templates/mcloud-devices.txt +++ b/roles/devices/templates/mcloud-devices.txt @@ -1,3 +1,3 @@ {% for device in devices %} -{{ device.name }}|{{ device.os }}|{{ device.id }}|{{ device.adb_port }}|{{ device.min_port }}|{{ device.max_port }}|{{ device.proxy_port | default('0') }}|{{ device.appium_port }}|{{ device.wireless | default('false') }}|{{ device.wda_file | default('/dev/null')}}|{{ device.wda_bundleid | default('com.facebook.WebDriverAgentRunner.xctrunner')}}|{{ device.server_proxy_port | default('0')}} +{{ device.id }}|{{ device.os }}|{{ device.name }}|{{ device.location | default('') }}|{{ device.appium_port }}|{{ device.adb_port }}|{{ device.proxy_port | default('0') }}|{{ device.server_proxy_port | default('0') }}|{{ device.min_port }}|{{ device.max_port }}|{{ device.wireless | default('false') }}|{{ device.wda_file | default('/dev/null') }}|{{ device.wda_bundleid | default('com.facebook.WebDriverAgentRunner.xctrunner') }} {% endfor %} diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index cc3be83..fa9fd5b 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -48,26 +48,30 @@ function create_containers() { local platform_name=$(cat ${devices} | grep "$udid" | cut -d '|' -f 2) #echo "platform_name: $platform_name" - local device_adb_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 4) - #echo "device_adb_port: $device_adb_port" + local location=$(cat ${devices} | grep "$udid" | cut -d '|' -f 4) + #echo "location: $location" - local stf_min_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 5) - #echo "stf_min_port: $stf_min_port" + local appium_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 5) + #echo "appium_port: $appium_port" - local stf_max_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 6) - #echo "stf_max_port: $stf_max_port" + local device_adb_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 6) + #echo "device_adb_port: $device_adb_port" local proxy_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 7) #echo "proxy_port: $proxy_port" - local appium_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 8) - #echo "appium_port: $appium_port" + local server_proxy_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 8) + #echo "server_proxy_port: $server_proxy_port" + + local stf_min_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 9) + #echo "stf_min_port: $stf_min_port" - local wireless=$(cat ${devices} | grep "$udid" | cut -d '|' -f 9) + local stf_max_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 10) + #echo "stf_max_port: $stf_max_port" + + local wireless=$(cat ${devices} | grep "$udid" | cut -d '|' -f 11) #echo "wireless: $wireless" - local server_proxy_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 12) - #echo "server_proxy_port: $server_proxy_port" # without 'block_global=false' mitmproxy does not want to accept requests from devices # --set confdir allows to provide custom folder with CA Authority certificates @@ -150,7 +154,7 @@ function create_containers() { -e STF_PROVIDER_DEVICE_NAME="${device_name}" \ -e DEVICE_UDID="$STF_DEVICE_UDID" \ -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ - -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}" \ + -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}${location:+_$location}" \ -e STF_PROVIDER_MIN_PORT=$stf_min_port \ -e STF_PROVIDER_MAX_PORT=$stf_max_port \ -p $stf_min_port-$stf_max_port:$stf_min_port-$stf_max_port \ @@ -219,7 +223,7 @@ function create_containers() { #TODO: comment echoing wda related detailes before release local wdaIpaPath={{ WDA_FILE }} - local deviceWdaIpaPath=$(cat ${devices} | grep "$udid" | cut -d '|' -f 10) + local deviceWdaIpaPath=$(cat ${devices} | grep "$udid" | cut -d '|' -f 12) if [ ! -z $deviceWdaIpaPath ] && [ ! "$deviceWdaIpaPath" == "/dev/null" ]; then wdaIpaPath=$deviceWdaIpaPath fi @@ -230,7 +234,7 @@ function create_containers() { echo "wdaIpaPath: $wdaIpaPath" local wdaBundleId={{ WDA_BUNDLEID }} - local deviceWdaBundleId=$(cat ${devices} | grep "$udid" | cut -d '|' -f 11) + local deviceWdaBundleId=$(cat ${devices} | grep "$udid" | cut -d '|' -f 13) if [ ! -z $deviceWdaBundleId ]; then wdaBundleId=$deviceWdaBundleId fi @@ -277,7 +281,7 @@ function create_containers() { -e STF_PROVIDER_DEVICE_NAME="${device_name}" \ -e DEVICE_UDID="${udid}" \ -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ - -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}" \ + -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}${location:+_$location}" \ -e STF_PROVIDER_MIN_PORT=$stf_min_port \ -e STF_PROVIDER_MAX_PORT=$stf_max_port \ -p $stf_min_port-$stf_max_port:$stf_min_port-$stf_max_port \ @@ -348,9 +352,9 @@ function stop() { # if $device is empty do stop for all connected devices otherwise stop only filtered if [ ! -z $filter_device ] && [ "$filter_device" != "ios" ] && [ "$filter_device" != "android" ]; then echo stopping containers for $filter_device... - local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) local device_name_underscored=${device_name// /_} - local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) if [ -z "$device_name" ] || [ -z $udid ]; then echo_warning "Unable to find device by \"$filter_device\"!" @@ -361,13 +365,13 @@ function stop() { else # as no device filter provided continue with stopping all device containers while read -r line; do - local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) #echo "device_name: $device_name" local device_name_underscored=${device_name// /_} - local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) #echo "udid: $udid" - local wireless=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 9) + local wireless=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 11) if [ -L "/dev/device-${device_name}-${udid}" ] || [ "$wireless" == "True" ]; then stop_containers ${device_name_underscored} ${udid} @@ -402,9 +406,9 @@ function down() { # if $device is empty do rm for all connected devices otherwise rm only filtered if [ ! -z $filter_device ] && [ "$filter_device" != "ios" ] && [ "$filter_device" != "android" ]; then #echo removing containers for $filter_device... - local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) local device_name_underscored=${device_name// /_} - local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) if [ -z "$device_name" ] || [ -z $udid ]; then echo_warning "Unable to find device by \"$filter_device\"!" @@ -414,11 +418,11 @@ function down() { remove_containers ${device_name_underscored} ${udid} else while read -r line; do - local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) #echo "device_name: $device_name" local device_name_underscored=${device_name// /_} - local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) #echo "udid: $udid" remove_containers ${device_name_underscored} ${udid} done < ${devices} @@ -529,7 +533,7 @@ function verify_containers() { local udid=$2 #echo "udid: $udid" - local wireless=$(cat ${devices} | grep "$udid" | cut -d '|' -f 9) + local wireless=$(cat ${devices} | grep "$udid" | cut -d '|' -f 11) local container=device-$device-$udid if [ ! -L "/dev/$container" ] && [ "$wireless" != "True" ]; then @@ -590,9 +594,9 @@ function start() { # if $device is empty do start for all connected devices otherwise start only filtered if [ ! -z $filter_device ] && [ "$filter_device" != "ios" ] && [ "$filter_device" != "android" ]; then - local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) local device_name_underscored=${device_name// /_} - local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) if [ -z "$device_name" ] || [ -z $udid ]; then echo_warning "Unable to find device by \"$filter_device\"!" @@ -603,13 +607,13 @@ function start() { echo -e "\n-----------------------------------------------------------------" else while read -r line; do - local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) #echo "device_name: $device_name" local device_name_underscored=${device_name// /_} - local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) #echo "udid: $udid" - local wireless=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 9) + local wireless=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 11) if [ -L "/dev/device-${device_name}-${udid}" ] || [ "$wireless" == "True" ]; then create_containers "${device_name}" "${udid}" "${device_name_underscored}" && start_containers "${device_name}" "${udid}" "${device_name_underscored}" echo -e "\n-----------------------------------------------------------------" @@ -643,18 +647,18 @@ function status() { # if $device is empty do start for all connected devices otherwise start only filtered if [ ! -z $filter_device ] && [ "$filter_device" != "ios" ] && [ "$filter_device" != "android" ]; then - local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) #echo "device_name: $device_name" local device_name_underscored=${device_name// /_} - local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) #echo "udid: $udid" verify_containers "${device_name_underscored}" "${udid}" else while read -r line; do - local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) #echo "device_name: $device_name" local device_name_underscored=${device_name// /_} - local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) if [ -z $udid ]; then continue fi diff --git a/roles/devices/vars/main.yml.original b/roles/devices/vars/main.yml.original index 20ce102..e948430 100644 --- a/roles/devices/vars/main.yml.original +++ b/roles/devices/vars/main.yml.original @@ -56,6 +56,7 @@ WDA_BUNDLEID: # [OBLIGATORY] Declare valid devices metadata # - id: device udid which is shown by `adb devices` # name: device name as it will be registered in STF (avoid special symbols and spaces!) +# location: clarified device location for ease of device management (an underscore will be added automatically before the value) # appium_port: unique port value for sharing appium services from the container to outside selenium hub # adb_port: unique port value for sharing adb server from the device appium container to outside # proxy_port: unique port value to configure embedded proxy (they can be used in integration with Carina traffic sniffering functionality: https://zebrunner.github.io/carina/advanced/proxy/) @@ -66,6 +67,7 @@ devices: - id: R28M1384YQY os: android name: Samsung_Galaxy_S10 + location: location_1 appium_port: 7421 adb_port: 7422 proxy_port: 7423 @@ -75,6 +77,7 @@ devices: - id: d6afc6b3a65584ca0813eb8957c6479b9b6ebb11 os: ios name: iPhone_8_Plus + location: location_2 appium_port: 7431 adb_port: 7432 proxy_port: 7433 diff --git a/roles/mac-devices/templates/mcloud-devices.txt b/roles/mac-devices/templates/mcloud-devices.txt index 0fcaa33..e1f034f 100644 --- a/roles/mac-devices/templates/mcloud-devices.txt +++ b/roles/mac-devices/templates/mcloud-devices.txt @@ -1,4 +1,3 @@ {% for device in devices %} -{{ device.name }}|{{ device.os }}|{{ device.id }}|{{ device.adb_port }}|{{ device.min_port }}|{{ device.max_port }}|{{ device.proxy_port | default('0') }}|{{ device.appium_port }}|{{ device.wireless | default('false') }}|{{ device.wda_file | -default('/dev/null')}}|{{ device.wda_bundleid | default('com.facebook.WebDriverAgentRunner.xctrunner')}}|{{ device.server_proxy_port | default('0') }} +{{ device.id }}|{{ device.os }}|{{ device.name }}|{{ device.location | default('') }}|{{ device.appium_port }}|{{ device.adb_port }}|{{ device.proxy_port | default('0') }}|{{ device.server_proxy_port | default('0') }}|{{ device.min_port }}|{{ device.max_port }}|{{ device.wireless | default('false') }}|{{ device.wda_file | default('/dev/null') }}|{{ device.wda_bundleid | default('com.facebook.WebDriverAgentRunner.xctrunner') }} {% endfor %} diff --git a/roles/mac-devices/templates/zebrunner-farm b/roles/mac-devices/templates/zebrunner-farm index e740557..c699c25 100755 --- a/roles/mac-devices/templates/zebrunner-farm +++ b/roles/mac-devices/templates/zebrunner-farm @@ -42,7 +42,7 @@ on-usb-update() { echo udid: $udid local devices=/usr/local/bin/mcloud-devices.txt - local device_name=$(cat ${devices} | grep "$udid" | cut -d '|' -f 1) + local device_name=$(cat ${devices} | grep "$udid" | cut -d '|' -f 3) local device_name_underscored=${device_name// /_} echo "device_name_underscored: $device_name_underscored" if [ -z $device_name_underscored ]; then @@ -112,24 +112,27 @@ function create_containers() { local platform_name=$(cat ${devices} | grep "$udid" | cut -d '|' -f 2) #echo "platform_name: $platform_name" - local device_adb_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 4) - #echo "device_adb_port: $device_adb_port" + local location=$(cat ${devices} | grep "$udid" | cut -d '|' -f 4) + #echo "location: $location" - local stf_min_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 5) - #echo "stf_min_port: $stf_min_port" + local appium_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 5) + #echo "appium_port: $appium_port" - local stf_max_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 6) - #echo "stf_max_port: $stf_max_port" + local device_adb_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 6) + #echo "device_adb_port: $device_adb_port" local proxy_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 7) #echo "proxy_port: $proxy_port" - local appium_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 8) - #echo "appium_port: $appium_port" - - local server_proxy_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 12) + local server_proxy_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 8) #echo "server_proxy_port: $server_proxy_port" + local stf_min_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 9) + #echo "stf_min_port: $stf_min_port" + + local stf_max_port=$(cat ${devices} | grep "$udid" | cut -d '|' -f 10) + #echo "stf_max_port: $stf_max_port" + # without 'block_global=false' mitmproxy does not want to accept requests from devices # --set confdir allows to provide custom folder with CA Authority certificates local proxy_permament_arguments="--set block_global=false --set confdir=/opt/mitmproxy" @@ -156,7 +159,7 @@ function create_containers() { if [ "$platform_name" == "ios" ]; then local wdaIpaPath={{ WDA_FILE }} - local deviceWdaIpaPath=$(cat ${devices} | grep "$udid" | cut -d '|' -f 10) + local deviceWdaIpaPath=$(cat ${devices} | grep "$udid" | cut -d '|' -f 12) if [ ! -z $deviceWdaIpaPath ] && [ ! "$deviceWdaIpaPath" == "/dev/null" ]; then wdaIpaPath=$deviceWdaIpaPath fi @@ -167,7 +170,7 @@ function create_containers() { echo "wdaIpaPath: $wdaIpaPath" local wdaBundleId={{ WDA_BUNDLEID }} - local deviceWdaBundleId=$(cat ${devices} | grep "$udid" | cut -d '|' -f 11) + local deviceWdaBundleId=$(cat ${devices} | grep "$udid" | cut -d '|' -f 13) if [ ! -z $deviceWdaBundleId ]; then wdaBundleId=$deviceWdaBundleId fi @@ -212,7 +215,7 @@ function create_containers() { -e STF_PROVIDER_DEVICE_NAME="${device_name}" \ -e DEVICE_UDID="${udid}" \ -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ - -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}" \ + -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}${location:+_$location}" \ -e STF_PROVIDER_MIN_PORT=$stf_min_port \ -e STF_PROVIDER_MAX_PORT=$stf_max_port \ -p $stf_min_port-$stf_max_port:$stf_min_port-$stf_max_port \ @@ -283,9 +286,9 @@ function stop() { # if $filter_device is empty do stop for all connected devices otherwise stop only filtered if [ ! -z $filter_device ] && [ "$filter_device" != "ios" ] && [ "$filter_device" != "android" ]; then echo stopping containers for $filter_device... - local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) local device_name_underscored=${device_name// /_} - local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) if [ -z "$device_name" ] || [ -z $udid ]; then echo_warning "Unable to find device by \"$filter_device\"!" @@ -298,10 +301,10 @@ function stop() { # as no device filter provided continue with stopping all device containers while read -r line; do - local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) local device_name_underscored=${device_name// /_} #echo "device_name_underscored: $device_name_underscored" - local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) #echo "udid: $udid" stop_containers ${device_name_underscored} ${udid} done < ${devices} @@ -333,9 +336,9 @@ function down() { # if $filter_device is empty do rm for all connected devices otherwise rm only filtered if [ ! -z $filter_device ] && [ "$filter_device" != "ios" ] && [ "$filter_device" != "android" ]; then #echo removing containers for $filter_device... - local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) local device_name_underscored=${device_name// /_} - local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) if [ -z $device_name ] || [ -z $udid ]; then echo_warning "Unable to find device by \"$filter_device\"!" @@ -347,10 +350,10 @@ function down() { launchctl unload $HOME/Library/LaunchAgents/ZebrunnerDevicesListener.plist > /dev/null 2>&1 while read -r line; do - local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) local device_name_underscored=${device_name// /_} #echo "device_name_underscored: $device_name_underscored" - local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) #echo "udid: $udid" remove_containers ${device_name_underscored} ${udid} done < ${devices} @@ -545,9 +548,9 @@ function start() { # if $filter_device is empty do start for all connected devices otherwise start only filtered if [ ! -z $filter_device ] && [ "$filter_device" != "ios" ] && [ "$filter_device" != "android" ]; then - local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) local device_name_underscored=${device_name// /_} - local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) if [ -z $device_name ] || [ -z $udid ]; then echo_warning "Unable to find device by \"$filter_device\"!" @@ -558,10 +561,10 @@ function start() { echo -e "\n-----------------------------------------------------------------" else while read -r line; do - local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) local device_name_underscored=${device_name// /_} #echo "device_name_underscored: $device_name_underscored" - local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) #echo "udid: $udid" create_containers "${device_name}" "${udid}" "${device_name_underscored}" && start_containers "${device_name}" "${udid}" "${device_name_underscored}" echo -e "\n-----------------------------------------------------------------" @@ -596,18 +599,18 @@ function status() { local devices=/usr/local/bin/mcloud-devices.txt if [ ! -z $filter_device ] && [ "$filter_device" != "ios" ] && [ "$filter_device" != "android" ]; then - local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) local device_name_underscored=${device_name// /_} #echo "device_name_underscored: $device_name_underscored" - local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(cat ${devices} | grep "$filter_device" | cut -d '|' -f 1) #echo "udid: $udid" verify_containers "${device_name_underscored}" "${udid}" else while read -r line; do - local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) + local device_name=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) local device_name_underscored=${device_name// /_} #echo "device_name_underscored: $device_name_underscored" - local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 3) + local udid=$(echo ${line} | grep "$filter_device" | cut -d '|' -f 1) if [ -z $udid ]; then continue fi diff --git a/roles/mac-devices/vars/main.yml.original b/roles/mac-devices/vars/main.yml.original index f3cbe35..e14ebc3 100644 --- a/roles/mac-devices/vars/main.yml.original +++ b/roles/mac-devices/vars/main.yml.original @@ -58,6 +58,7 @@ WDA_BUNDLEID: # [OBLIGATORY] Declare valid devices metadata # - id: device udid which is shown by `ios list` # name: device name as it will be registered in STF (avoid special symbols and spaces!) +# location: clarified device location for ease of device management (an underscore will be added automatically before the value) # appium_port: unique port value for sharing appium services from the container to outside selenium hub # adb_port: unique connect port value (old adb_port name is used from Android implementation) # proxy_port: unique port value to configure embedded proxy (they can be used in integration with Carina traffic sniffering functionality: https://zebrunner.github.io/carina/advanced/proxy/) @@ -68,6 +69,7 @@ devices: - id: d6afc6b3a65584ca0813eb8957c6479b9b6ebb11 os: ios name: iPhone_8_Plus + location: location_1 appium_port: 7431 adb_port: 7432 proxy_port: 7433