added culebra support

Summary: Ref T2744

Reviewers: #testers, kuba-orlik

Reviewed By: #testers, kuba-orlik

Subscribers: kuba-orlik

Maniphest Tasks: T2744

Differential Revision: https://hub.sealcode.org/D1361
This commit is contained in:
migueldar 2024-01-18 18:48:18 +01:00
parent 1ea7b42e29
commit 7a25b95420
5 changed files with 21 additions and 6 deletions

View File

@ -5,7 +5,7 @@ ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/andro
RUN sdkmanager "system-images;android-33;google_apis;x86_64"
RUN echo no | avdmanager create avd -n virtual_dev -b google_apis/x86_64 -k "system-images;android-33;google_apis;x86_64"
RUN apt-get update && apt-get install -y iproute2 iputils-ping iptables redsocks npm
RUN apt-get update && apt-get install -y iproute2 iputils-ping iptables redsocks npm git
EXPOSE 3000

View File

@ -1,11 +1,12 @@
hashed_name=`openssl x509 -inform PEM -subject_hash_old -in /ca-cert.cer | head -1`
emulator -avd virtual_dev -writable-system -no-window -no-audio &
npm i -C /code
cp /ca-cert.cer /$hashed_name.0
bash /conf/install_cert.sh $hashed_name.0
bash /conf/install_culebra.sh
bash /conf/iptables_conf.sh
redsocks -c /conf/redsocks.conf &
emulator -avd virtual_dev -writable-system -no-window -no-audio &
bash /conf/install_cert.sh $hashed_name.0
bash /conf/wait_for_sd.sh
#wait for cert to be installed before launching socket server
node /code/index.js

View File

@ -0,0 +1,15 @@
cd /root
git clone https://github.com/dtmilano/CulebraTester2-public culebra
git clone https://gist.github.com/dtmilano/4537110 culebraDependencies
export PATH=$PATH:/root/culebraDependencies
cd culebra
git checkout 4ce1987e7ec6ae627d8f33a1a3b59f684aff90c0
echo "/opt/android-sdk-linux" >> local.properties
./gradlew installDebug installDebugAndroidTest
./culebratester2 start-server &
#wait for the server to start
while ! curl http://localhost:9987/v2/uiDevice/screenshot > /dev/null 2> /dev/null; do
sleep 0.1
done

View File

@ -1,2 +1 @@
/opt/android-sdk-linux/platform-tools/adb shell screencap /sdcard/screenshot.png
/opt/android-sdk-linux/platform-tools/adb pull /sdcard/screenshot.png /screenshot.png
curl http://localhost:9987/v2/uiDevice/screenshot -o /screenshot.png

View File

@ -6,6 +6,6 @@ WORKDIR /code
RUN mkdir /images
ENV screenshotDelayMs 1000
ENV screenshotDelayMs 500
CMD sh /code/docker-entrypoint.sh