Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[android] reverse tethering support to share network via usb #262

Open
KostyaSha opened this issue Oct 25, 2023 · 0 comments
Open

[android] reverse tethering support to share network via usb #262

KostyaSha opened this issue Oct 25, 2023 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@KostyaSha
Copy link

KostyaSha commented Oct 25, 2023

Tested manually by fetching and running java version (rust version fails on GLIBC, probably needs recompile under docker image env). https://github.com/Genymobile/gnirehtet/tree/master
To run it needs few fetched files and execute command where adb is running. There is autorun option that should handle autosetup.

Maybe you can guide how better to add it as a feature? I guess it needs new ansible option, modify docker container, pass env var and update startup script.

As temp solution it was enough to extend Dockerfile

FROM public.ecr.aws/zebrunner/appium:2.0.1
USER androidusr:androidusr
RUN wget "https://github.com/Genymobile/gnirehtet/releases/download/v2.5.1/gnirehtet-java-v2.5.1.zip"
RUN unzip "gnirehtet-java-v2.5.1.zip"
USER root

and then add docker exec

diff --git a/defaults/main.yml b/defaults/main.yml
index 49e1125..2a3ebe1 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -2,8 +2,8 @@
 DEVICE_IMAGE: public.ecr.aws/zebrunner/mcloud-device
 DEVICE_VERSION: 2.5.1

-APPIUM_IMAGE: public.ecr.aws/zebrunner/appium
-APPIUM_VERSION: 2.0.1
+APPIUM_IMAGE: appium
+APPIUM_VERSION: 2.0.1-custom

 UPLOADER_IMAGE: public.ecr.aws/zebrunner/uploader
 UPLOADER_VERSION: 3.1
diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm
index f25c75b..3732fe4 100755
--- a/roles/devices/templates/zebrunner-farm
+++ b/roles/devices/templates/zebrunner-farm
@@ -105,6 +105,8 @@ function create_containers () {
         -e RELAXED_SECURITY=true \
         {{ APPIUM_IMAGE }}:{{ APPIUM_VERSION }} || echo 'already created'

+    docker exec -dt device-${device_name}-${udid}-appium \
+         bash -c 'cd /home/androidusr/gnirehtet-java/ && ./gnirehtet autorun  2>&1 > /dev/null' || echo "Failed to execute gnirehtet!"
+
     docker run -d --name device-${device_name}-${udid}-uploader --net=${net} \
         --restart on-failure \
         -v device-${device_name}-${udid}:/tmp/log \
@vdelendik vdelendik added this to the 2.7 milestone Nov 15, 2023
@vdelendik vdelendik added the enhancement New feature or request label Nov 15, 2023
@vdelendik vdelendik modified the milestones: 2.7, 3.0 May 17, 2024
@vdelendik vdelendik modified the milestones: 3.0, 3.1 Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants