• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3DEVICE_IMAGE_PATH="{img_path}"
4DEVICE_IMAGE_DIR=$(dirname "$DEVICE_IMAGE_PATH")
5CVD_HOST_PACKAGE_PATH="{cvd_host_package_path}"
6
7PATH_ADDITIONS="{path_additions}"
8TEST_EXECUTABLE="$1"
9shift
10
11LOCAL_TOOL="$(dirname "$CVD_HOST_PACKAGE_PATH")"
12
13user="$(whoami)"
14
15su - << EOF
16export PATH="${LOCAL_TOOL}:${PATH_ADDITIONS}:${PATH}"
17/usr/sbin/service rsyslog restart
18/etc/init.d/cuttlefish-common start
19/usr/sbin/usermod -aG kvm "${USER}"
20
21pushd "${LOCAL_TOOL}"
22tar xvf "${CVD_HOST_PACKAGE_PATH}"
23popd
24
25pushd "${DEVICE_IMAGE_DIR}"
26unzip -o "${DEVICE_IMAGE_PATH}"
27popd
28
29HOME="${LOCAL_TOOL}" "${LOCAL_TOOL}"/bin/launch_cvd \
30  -daemon \
31  -config=phone \
32  -system_image_dir "${DEVICE_IMAGE_DIR}" \
33  -undefok=report_anonymous_usage_stats,config \
34  -report_anonymous_usage_stats=y \
35  -instance_dir=/tmp/cvd \
36  -guest_enforce_security=false
37adb connect localhost:6520
38exit
39EOF
40
41"${TEST_EXECUTABLE}" "$@"