mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-30 17:50:46 +00:00
target: tests: Add support for testing ChromeOS targets
We can mimic ChromeOS target by combining a QEMU guest (for Linux bindings of ``ChromeOsTarget`` class) with a Android virtual desktop (for Android bits of ``ChromeOsTarget``). Note that Android bindings of ``ChromeOsTarget`` class also requires existence of ``/opt/google/containers/android`` folder on the Linux guest. Signed-off-by: Metin Kaya <metin.kaya@arm.com>
This commit is contained in:
parent
c6bd736c82
commit
ac4f581f4b
@ -3,6 +3,14 @@ AndroidTarget:
|
||||
connection_settings:
|
||||
device: 'emulator-5554'
|
||||
|
||||
ChromeOsTarget:
|
||||
entry-0:
|
||||
connection_settings:
|
||||
device: 'emulator-5556'
|
||||
host: 'example.com'
|
||||
username: 'username'
|
||||
password: 'password'
|
||||
|
||||
LinuxTarget:
|
||||
entry-0:
|
||||
connection_settings:
|
||||
|
@ -20,7 +20,7 @@ import os
|
||||
from pprint import pp
|
||||
import pytest
|
||||
|
||||
from devlib import AndroidTarget, LinuxTarget, LocalLinuxTarget, QEMUTargetRunner
|
||||
from devlib import AndroidTarget, ChromeOsTarget, LinuxTarget, LocalLinuxTarget, QEMUTargetRunner
|
||||
from devlib.utils.android import AdbConnection
|
||||
from devlib.utils.misc import load_struct_from_yaml
|
||||
|
||||
@ -53,6 +53,16 @@ def build_targets():
|
||||
l_target = LinuxTarget(connection_settings=entry['connection_settings'])
|
||||
targets.append((l_target, None))
|
||||
|
||||
if target_configs.get('ChromeOsTarget') is not None:
|
||||
print('> ChromeOS targets:')
|
||||
for entry in target_configs['ChromeOsTarget'].values():
|
||||
pp(entry)
|
||||
c_target = ChromeOsTarget(
|
||||
connection_settings=entry['connection_settings'],
|
||||
working_directory='/tmp/devlib-target',
|
||||
)
|
||||
targets.append((c_target, None))
|
||||
|
||||
if target_configs.get('LocalLinuxTarget') is not None:
|
||||
print('> LocalLinux targets:')
|
||||
for entry in target_configs['LocalLinuxTarget'].values():
|
||||
@ -72,7 +82,24 @@ def build_targets():
|
||||
qemu_settings=qemu_settings,
|
||||
connection_settings=connection_settings,
|
||||
)
|
||||
targets.append((qemu_runner.target, qemu_runner))
|
||||
|
||||
if entry.get('ChromeOsTarget') is None:
|
||||
targets.append((qemu_runner.target, qemu_runner))
|
||||
continue
|
||||
|
||||
# Leave termination of QEMU runner to ChromeOS target.
|
||||
targets.append((qemu_runner.target, None))
|
||||
|
||||
print('> ChromeOS targets:')
|
||||
pp(entry['ChromeOsTarget'])
|
||||
c_target = ChromeOsTarget(
|
||||
connection_settings={
|
||||
**entry['ChromeOsTarget']['connection_settings'],
|
||||
**qemu_runner.target.connection_settings,
|
||||
},
|
||||
working_directory='/tmp/devlib-target',
|
||||
)
|
||||
targets.append((c_target, qemu_runner))
|
||||
|
||||
return targets
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user