From 77aceb8258f85cf737af294023e616f2db3e2cfa Mon Sep 17 00:00:00 2001 From: Javi Merino Date: Thu, 21 Jul 2016 11:09:05 +0100 Subject: [PATCH 1/2] Vagrantfile: make sure ANDROID_HOME and PATH make it as variable names to bashrc When we write the new path to include the android SDK, the variables are expanded when the shell is running, resulting in the wrong export for PATH being created in bashrc because for the running shell ANDROID_HOME is undefined: export PATH=/platform-tools:/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Escape the $ so that the variables are expanded when bashrc is run. With this change, we end up with this in bashrc: export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 77cb5eb56..1a0ed2643 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -48,7 +48,7 @@ Vagrant.configure(2) do |config| echo unset $LC >> /home/vagrant/.bashrc done echo "export ANDROID_HOME=/vagrant/tools/android-sdk-linux" >> /home/vagrant/.bashrc - echo "export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH" >> /home/vagrant/.bashrc + echo 'export PATH=\$ANDROID_HOME/platform-tools:\$ANDROID_HOME/tools:\$PATH' >> /home/vagrant/.bashrc echo source init_env >> /home/vagrant/.bashrc echo "Virtual Machine Installation completed successfully! " -- GitLab From 48939b471727f672ca10df06b7a7434db3a21615 Mon Sep 17 00:00:00 2001 From: Javi Merino Date: Thu, 21 Jul 2016 13:57:31 +0100 Subject: [PATCH 2/2] Vagrantfile: Install Android SDK with built-tools With the current Android SDK installation in our Vagrant file, hmp_parity.py tests fail with: ====================================================================== ERROR: test suite for ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/nose/suite.py", line 208, in run self.setUp() File "/usr/lib/python2.7/dist-packages/nose/suite.py", line 291, in setUp self.setupContext(ancestor) File "/usr/lib/python2.7/dist-packages/nose/suite.py", line 314, in setupContext try_run(context, names) File "/usr/lib/python2.7/dist-packages/nose/util.py", line 471, in try_run return func() File "/vagrant/tests/eas/hmp_parity.py", line 125, in setUpClass cls.env = TestEnv(test_conf=TEST_CONF) File "/home/vagrant/lisa/libs/utils/env.py", line 189, in __init__ self._init() File "/home/vagrant/lisa/libs/utils/env.py", line 260, in _init self._init_target(force) File "/home/vagrant/lisa/libs/utils/env.py", line 446, in _init_target modules = self.__modules) File "/home/vagrant/lisa/libs/devlib/devlib/target.py", line 720, in __init__ shell_prompt=shell_prompt) File "/home/vagrant/lisa/libs/devlib/devlib/target.py", line 171, in __init__ self.connect() File "/home/vagrant/lisa/libs/devlib/devlib/target.py", line 740, in connect adb_disconnect(device) File "/home/vagrant/lisa/libs/devlib/devlib/utils/android.py", line 287, in adb_disconnect _check_env() File "/home/vagrant/lisa/libs/devlib/devlib/utils/android.py", line 447, in _check_env _env = _initialize_with_android_home(_AndroidEnvironment()) File "/home/vagrant/lisa/libs/devlib/devlib/utils/android.py", line 405, in _initialize_with_android_home _init_common(env) File "/home/vagrant/lisa/libs/devlib/devlib/utils/android.py", line 429, in _init_common raise HostError(msg.format(env.android_home)) HostError: ANDROID_HOME (/vagrant/tools/android-sdk-linux) does not appear to have valid Android SDK install (cannot find build-tools) Install build-tools to please devlib. --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 1a0ed2643..7b7ccf28e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -33,7 +33,7 @@ Vagrant.configure(2) do |config| expect -c ' set timeout -1; spawn ./tools/android-sdk-linux/tools/android update sdk --no-ui \ - -t tool,platform-tool,platform; + -t tool,platform-tool,platform,build-tools-24.0.1; expect { "Do you accept the license" { exp_send "y\r" ; exp_continue } eof -- GitLab