From 01ef769e16fd2cde4d44869fc4326947a06832cc Mon Sep 17 00:00:00 2001 From: vdelendik Date: Fri, 29 Jul 2022 21:12:10 +0300 Subject: [PATCH 01/11] #127: improved iOS appium startup sharing iOS device --- defaults/main.yml | 4 ++-- roles/devices/templates/zebrunner-farm | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 163368e..6a95a19 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,8 +1,8 @@ --- DEVICE_IMAGE: zebrunner/mcloud-device -DEVICE_VERSION: 2.2.2 +DEVICE_VERSION: 2.3-beta8 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium -APPIUM_VERSION: 1.4.5 +APPIUM_VERSION: 1.4.6-beta8 DEVELOPER_IMAGES: {12.0, 12.1, 12.2, 12.3, 12.4, 13.0, 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 14.0, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 14.8, 15.0, 15.1, 15.2, 15.3, 15.4, 15.5} diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index 5e7ad2e..02aa18b 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -67,6 +67,8 @@ function create_containers () { local net={{ STF_DOCKER_NETWORK }} docker network inspect ${net} >/dev/null 2>&1 || docker network create ${net} + usb_bus=`readlink -f /dev/device-${device_name}-${udid}` + echo "usb_bus: ${usb_bus}" if [ $platform_name == "android" ]; then docker run -itd --name device-${device_name}-${udid}-appium --network ${net} \ @@ -123,8 +125,7 @@ function create_containers () { --restart on-failure \ -v appium-storage-volume:/opt/appium-storage \ -v mcloud-storage-volume:/opt/zebrunner \ - -v /var/run/usbmuxd:/var/run/usbmuxd \ - -v /var/lib/lockdown:/var/lib/lockdown \ + --device=/dev/device-${device_name}-${udid}:${usb_bus} \ -v "{{ WDA_IPA_PATH }}:/opt/WebDriverAgent.ipa" \ -e APPIUM_CLI="--session-override" \ -e WDA_ENV=/opt/zebrunner/wda-${udid}.env \ @@ -155,8 +156,6 @@ function create_containers () { --restart on-failure \ --link device-${device_name}-${udid}-appium:appium \ -v mcloud-storage-volume:/opt/zebrunner \ - -v /var/run/usbmuxd:/var/run/usbmuxd \ - -v /var/lib/lockdown:/var/lib/lockdown \ -e WDA_ENV=/opt/zebrunner/wda-${udid}.env \ -e WDA_WAIT_TIMEOUT=180 \ -e PLATFORM_NAME=$platform_name \ From 0e50280a31fd20d7c4c17b4fb6e43958a333f243 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Sat, 30 Jul 2022 12:56:45 +0300 Subject: [PATCH 02/11] #140: adjusted usbmuxd preparation steps --- README.md | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 8341fd1..8d713eb 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Feel free to support the development with a [**donation**](https://www.paypal.co ## Software prerequisites * Install docker ([Ubuntu 16.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04), [Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04), [Ubuntu 20.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04), [Amazon Linux 2](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html), [Redhat/Cent OS](https://www.cyberciti.biz/faq/install-use-setup-docker-on-rhel7-centos7-linux/)). * Install 2.9.6+ ansible ([Ubuntu 16.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-ubuntu-16-04), [Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-ubuntu-18-04), [Ubuntu 20.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-ubuntu-20-04)). -* Install and start usbmuxd service to be able to connect iOS devices. +* Install usbmuxd service to be able to connect iOS devices ## Initial setup * Run `./zebrunner.sh setup` script. @@ -50,23 +50,16 @@ Feel free to support the development with a [**donation**](https://www.paypal.co ### iOS devices -#### Adjust usbmuxd service +#### Mask usbmuxd service -1. Disable exit of usbmuxd service on disconnect of latest iOS device commenting in `/lib/udev/rules.d/39-usbmuxd.rules` such lines: - ``` - ## Exit usbmuxd when the last device is removed - #ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*", ENV{INTERFACE}=="255/*", RUN+="/usr/sbin/usbmuxd -x" - ``` - -2. Add restart policy and ExecStartPost command updating `/lib/systemd/system/usbmuxd.service`: - ``` - [Service] - Type=simple - ExecStart=/usr/sbin/usbmuxd --user usbmux --systemd - ExecStartPost=/usr/local/bin/zebrunner-farm restart ios - Restart=always - PIDFile=/var/run/usbmuxd.pid - ``` +``` +sudo systemctl mask usbmuxd +sudo systemctl status usbmuxd +-> +● usbmuxd.service + Loaded: masked (/dev/null; bad) + Active: inactive (dead) +``` #### [Optional] Supervise device From c2505c156f42e420ecd41808739ef89ae5348e2b Mon Sep 17 00:00:00 2001 From: vdelendik Date: Mon, 1 Aug 2022 15:29:35 +0300 Subject: [PATCH 03/11] switched to the 2.3-beta9 mcloud-device --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 6a95a19..677ac4e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- DEVICE_IMAGE: zebrunner/mcloud-device -DEVICE_VERSION: 2.3-beta8 +DEVICE_VERSION: 2.3-beta9 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium APPIUM_VERSION: 1.4.6-beta8 From 5e8a9a92e65d3a820da5cd97f0b10389dac8a3cb Mon Sep 17 00:00:00 2001 From: vdelendik Date: Mon, 1 Aug 2022 19:28:40 +0300 Subject: [PATCH 04/11] switched to the 2.3-beta11 stf --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 677ac4e..542048c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- DEVICE_IMAGE: zebrunner/mcloud-device -DEVICE_VERSION: 2.3-beta9 +DEVICE_VERSION: 2.3-beta11 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium APPIUM_VERSION: 1.4.6-beta8 From b113f935bfbcd1e45e82bdfb3b68508026981e58 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Sun, 7 Aug 2022 15:15:00 +0300 Subject: [PATCH 05/11] switched to the 2.3-beta17 stf and 1.4.6-beta9 apium --- defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 542048c..ccbfc80 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,8 +1,8 @@ --- DEVICE_IMAGE: zebrunner/mcloud-device -DEVICE_VERSION: 2.3-beta11 +DEVICE_VERSION: 2.3-beta17 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium -APPIUM_VERSION: 1.4.6-beta8 +APPIUM_VERSION: 1.4.6-beta9 DEVELOPER_IMAGES: {12.0, 12.1, 12.2, 12.3, 12.4, 13.0, 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 14.0, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 14.8, 15.0, 15.1, 15.2, 15.3, 15.4, 15.5} From 8bc38653946269a53c1572ddcd9f92f88edb8af8 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Mon, 8 Aug 2022 19:37:30 +0300 Subject: [PATCH 06/11] switched to the 2.3-beta21 mcloud-device --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index ccbfc80..e81d02e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- DEVICE_IMAGE: zebrunner/mcloud-device -DEVICE_VERSION: 2.3-beta17 +DEVICE_VERSION: 2.3-beta21 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium APPIUM_VERSION: 1.4.6-beta9 From a585efc3d02bc492b490fe2eab20a9e0b59f5ffd Mon Sep 17 00:00:00 2001 From: vdelendik Date: Tue, 9 Aug 2022 18:12:24 +0300 Subject: [PATCH 07/11] switched to the 2.3-beta23 mcloud-device --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index e81d02e..bb15f88 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- DEVICE_IMAGE: zebrunner/mcloud-device -DEVICE_VERSION: 2.3-beta21 +DEVICE_VERSION: 2.3-beta23 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium APPIUM_VERSION: 1.4.6-beta9 From b437ee9e974b57c95f660b8f7c9db1c78e5620f7 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Thu, 18 Aug 2022 16:36:25 +0300 Subject: [PATCH 08/11] switched to the 1.4.6-beta10 appium --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index bb15f88..b1ae794 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,6 +3,6 @@ DEVICE_IMAGE: zebrunner/mcloud-device DEVICE_VERSION: 2.3-beta23 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium -APPIUM_VERSION: 1.4.6-beta9 +APPIUM_VERSION: 1.4.6-beta10 DEVELOPER_IMAGES: {12.0, 12.1, 12.2, 12.3, 12.4, 13.0, 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 14.0, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 14.8, 15.0, 15.1, 15.2, 15.3, 15.4, 15.5} From c5b15ef1b1c7bd7286f5bf747e4a5effdef6a8f0 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Fri, 19 Aug 2022 12:43:07 +0300 Subject: [PATCH 09/11] switched to the released mcloud-device:2.3 --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index b1ae794..423ebf9 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- DEVICE_IMAGE: zebrunner/mcloud-device -DEVICE_VERSION: 2.3-beta23 +DEVICE_VERSION: 2.3 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium APPIUM_VERSION: 1.4.6-beta10 From f4e81a4e2c49ae3444818f57016adcbaf20efafe Mon Sep 17 00:00:00 2001 From: vdelendik Date: Fri, 19 Aug 2022 12:51:21 +0300 Subject: [PATCH 10/11] switched to the released 1.4.6 appium --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 423ebf9..f867293 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,6 +3,6 @@ DEVICE_IMAGE: zebrunner/mcloud-device DEVICE_VERSION: 2.3 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium -APPIUM_VERSION: 1.4.6-beta10 +APPIUM_VERSION: 1.4.6 DEVELOPER_IMAGES: {12.0, 12.1, 12.2, 12.3, 12.4, 13.0, 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 14.0, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 14.8, 15.0, 15.1, 15.2, 15.3, 15.4, 15.5} From 6b4525eb229ec0bd323b8807d9c10c8b151ebccf Mon Sep 17 00:00:00 2001 From: vdelendik Date: Fri, 19 Aug 2022 12:52:32 +0300 Subject: [PATCH 11/11] comment debug message --- roles/devices/templates/zebrunner-farm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index 02aa18b..8ebbcdf 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -68,7 +68,7 @@ function create_containers () { docker network inspect ${net} >/dev/null 2>&1 || docker network create ${net} usb_bus=`readlink -f /dev/device-${device_name}-${udid}` - echo "usb_bus: ${usb_bus}" + #echo "usb_bus: ${usb_bus}" if [ $platform_name == "android" ]; then docker run -itd --name device-${device_name}-${udid}-appium --network ${net} \