1 | #!/usr/bin/env bash
|
---|
2 | # shellcheck disable=SC2086 # we want word splitting
|
---|
3 |
|
---|
4 | section_start cuttlefish_setup "cuttlefish: setup"
|
---|
5 | set -xe
|
---|
6 |
|
---|
7 | export HOME=/cuttlefish
|
---|
8 | export PATH=$PATH:/cuttlefish/bin
|
---|
9 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${CI_PROJECT_DIR}/install/lib/:/cuttlefish/lib64
|
---|
10 | export EGL_PLATFORM=surfaceless
|
---|
11 |
|
---|
12 | syslogd
|
---|
13 |
|
---|
14 | chown root.kvm /dev/kvm
|
---|
15 |
|
---|
16 | /etc/init.d/cuttlefish-host-resources start
|
---|
17 |
|
---|
18 | cd /cuttlefish
|
---|
19 |
|
---|
20 | launch_cvd --verbosity=DEBUG --report_anonymous_usage_stats=n --cpus=8 --memory_mb=8192 --gpu_mode="$ANDROID_GPU_MODE" --daemon --enable_minimal_mode=true --guest_enforce_security=false --use_overlay=false
|
---|
21 | sleep 1
|
---|
22 |
|
---|
23 | cd -
|
---|
24 |
|
---|
25 | adb connect vsock:3:5555
|
---|
26 | ADB="adb -s vsock:3:5555"
|
---|
27 |
|
---|
28 | $ADB root
|
---|
29 | sleep 1
|
---|
30 | $ADB shell echo Hi from Android
|
---|
31 | # shellcheck disable=SC2035
|
---|
32 | $ADB logcat dEQP:D *:S &
|
---|
33 |
|
---|
34 | # overlay vendor
|
---|
35 |
|
---|
36 | OV_TMPFS="/data/overlay-remount"
|
---|
37 | $ADB shell mkdir -p "$OV_TMPFS"
|
---|
38 | $ADB shell mount -t tmpfs none "$OV_TMPFS"
|
---|
39 |
|
---|
40 | $ADB shell mkdir -p "$OV_TMPFS/vendor-upper"
|
---|
41 | $ADB shell mkdir -p "$OV_TMPFS/vendor-work"
|
---|
42 |
|
---|
43 | opts="lowerdir=/vendor,upperdir=$OV_TMPFS/vendor-upper,workdir=$OV_TMPFS/vendor-work"
|
---|
44 | $ADB shell mount -t overlay -o "$opts" none /vendor
|
---|
45 |
|
---|
46 | $ADB shell setenforce 0
|
---|
47 |
|
---|
48 | # deqp
|
---|
49 |
|
---|
50 | $ADB push /deqp/modules/egl/deqp-egl-android /data/.
|
---|
51 | $ADB push /deqp/assets/gl_cts/data/mustpass/egl/aosp_mustpass/3.2.6.x/egl-master.txt /data/.
|
---|
52 | $ADB push /deqp-runner/deqp-runner /data/.
|
---|
53 |
|
---|
54 | # download Android Mesa from S3
|
---|
55 | MESA_ANDROID_ARTIFACT_URL=https://${PIPELINE_ARTIFACTS_BASE}/${S3_ARTIFACT_NAME}.tar.zst
|
---|
56 | curl -L --retry 4 -f --retry-all-errors --retry-delay 60 -o ${S3_ARTIFACT_NAME}.tar.zst ${MESA_ANDROID_ARTIFACT_URL}
|
---|
57 | tar -xvf ${S3_ARTIFACT_NAME}.tar.zst
|
---|
58 | rm "${S3_ARTIFACT_NAME}.tar.zst" &
|
---|
59 |
|
---|
60 | $ADB push install/all-skips.txt /data/.
|
---|
61 | $ADB push install/$GPU_VERSION-flakes.txt /data/.
|
---|
62 | $ADB push install/deqp-$DEQP_SUITE.toml /data/.
|
---|
63 |
|
---|
64 | # remove 32 bits libs from /vendor/lib
|
---|
65 |
|
---|
66 | $ADB shell rm /vendor/lib/dri/${ANDROID_DRIVER}_dri.so
|
---|
67 | $ADB shell rm /vendor/lib/libglapi.so
|
---|
68 | $ADB shell rm /vendor/lib/egl/libGLES_mesa.so
|
---|
69 |
|
---|
70 | $ADB shell rm /vendor/lib/egl/libEGL_angle.so
|
---|
71 | $ADB shell rm /vendor/lib/egl/libEGL_emulation.so
|
---|
72 | $ADB shell rm /vendor/lib/egl/libGLESv1_CM_angle.so
|
---|
73 | $ADB shell rm /vendor/lib/egl/libGLESv1_CM_emulation.so
|
---|
74 | $ADB shell rm /vendor/lib/egl/libGLESv2_angle.so
|
---|
75 | $ADB shell rm /vendor/lib/egl/libGLESv2_emulation.so
|
---|
76 |
|
---|
77 | # replace on /vendor/lib64
|
---|
78 |
|
---|
79 | $ADB push install/lib/dri/${ANDROID_DRIVER}_dri.so /vendor/lib64/dri/${ANDROID_DRIVER}_dri.so
|
---|
80 | $ADB push install/lib/libglapi.so /vendor/lib64/libglapi.so
|
---|
81 | $ADB push install/lib/libEGL.so /vendor/lib64/egl/libEGL_mesa.so
|
---|
82 |
|
---|
83 | $ADB shell rm /vendor/lib64/egl/libEGL_angle.so
|
---|
84 | $ADB shell rm /vendor/lib64/egl/libEGL_emulation.so
|
---|
85 | $ADB shell rm /vendor/lib64/egl/libGLESv1_CM_angle.so
|
---|
86 | $ADB shell rm /vendor/lib64/egl/libGLESv1_CM_emulation.so
|
---|
87 | $ADB shell rm /vendor/lib64/egl/libGLESv2_angle.so
|
---|
88 | $ADB shell rm /vendor/lib64/egl/libGLESv2_emulation.so
|
---|
89 |
|
---|
90 |
|
---|
91 | RESULTS=/data/results
|
---|
92 | uncollapsed_section_switch cuttlefish_test "cuttlefish: testing"
|
---|
93 |
|
---|
94 | set +e
|
---|
95 | $ADB shell "mkdir /data/results; cd /data; ./deqp-runner \
|
---|
96 | suite \
|
---|
97 | --suite /data/deqp-$DEQP_SUITE.toml \
|
---|
98 | --output $RESULTS \
|
---|
99 | --skips /data/all-skips.txt $DEQP_SKIPS \
|
---|
100 | --flakes /data/$GPU_VERSION-flakes.txt \
|
---|
101 | --testlog-to-xml /deqp/executor/testlog-to-xml \
|
---|
102 | --fraction-start $CI_NODE_INDEX \
|
---|
103 | --fraction $(( CI_NODE_TOTAL * ${DEQP_FRACTION:-1})) \
|
---|
104 | --jobs ${FDO_CI_CONCURRENT:-4} \
|
---|
105 | $DEQP_RUNNER_OPTIONS"
|
---|
106 |
|
---|
107 | EXIT_CODE=$?
|
---|
108 | set -e
|
---|
109 | section_switch cuttlefish_results "cuttlefish: gathering the results"
|
---|
110 |
|
---|
111 | $ADB pull $RESULTS results
|
---|
112 |
|
---|
113 | cp /cuttlefish/cuttlefish/instances/cvd-1/logs/logcat results
|
---|
114 | cp /cuttlefish/cuttlefish/instances/cvd-1/kernel.log results
|
---|
115 | cp /cuttlefish/cuttlefish/instances/cvd-1/logs/launcher.log results
|
---|
116 |
|
---|
117 | section_end cuttlefish_results
|
---|
118 | exit $EXIT_CODE
|
---|