-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add support for testing ChromeOS targets #673
Conversation
devlib/target.py
Outdated
platform=platform, | ||
working_directory=working_directory, | ||
executables_directory=executables_directory, | ||
connect=False, | ||
modules=modules, | ||
load_default_modules=load_default_modules, | ||
shell_prompt=shell_prompt, | ||
conn_cls=SshConnection, | ||
is_container=is_container, | ||
max_async=max_async) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might go the extra mile and just remove the link between length of the function name and indentation:
foobarextremelylongandalsowewillchangeittomorrowandbreakindentation(
iamaparameterandidontcareaboutmyfunctionnamelength=42,
...,
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer current indentation scheme which matches Linux kernel style, but set the indentation to 4 spaces here and similar block below (self.android_container = AndroidTarget(...))
.
devlib/target.py
Outdated
@@ -3041,7 +3044,7 @@ def __init__(self, | |||
working_directory=android_working_directory, | |||
executables_directory=android_executables_directory, | |||
connect=False, | |||
modules=[], # Only use modules with linux target | |||
modules=[], # Only use modules with linux target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's unrelated to this PR so maybe don't fix it here, but that's a nice antipattern in there: mutable default values. The default value is created when the function is created. Then that specific instance will be used for all function calls where no value is specified:
def foo(x, mylist=[]):
mylist.append(x)
return mylist
foo(1)
foo(2)
mylist = foo(3)
assert mylist == [1, 2, 3]
So the moral here is: never use mutable values as defaults. None
is not mutable (or it is mutable but has no state to actually mutate, so both views are actually valid), so it makes a nice default. If an empty iterable default was really wanted, tuple()
would do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed modules
param since it defaults to None
already.
Also clean a mutable default value (``modules=[]`` in ``ChromeOsTarget`` class). Signed-off-by: Metin Kaya <[email protected]>
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 <[email protected]>
Commits: