[MobLab] Moblab Setup page.
* Adds a new page located at /moblab_setup
* 2 are on this page: 1 to upload a Boto Key and 1 to edit the config values.
* Link to /moblab_setup is visible only on a moblab system.
* RPC's that execute moblab_setup's actions are gated by a decorator that
limits them to only run on a moblab_system.
* Unittests for new RPC's.
* Editting the config values, writes the full config to shadow_config.ini and
reboots the system so changes takes effort.
* Resetting the config values, makes shadow_config.ini an empty file and
reboots the system so it is restored.
* Uploading the boto key uses shutil.copyfile to write in the new boto file's
contents to the boto file location.
BUG=chromium:396694
TEST=unittests, Uploaded a boto key and successfully ran a suite, editted
config and ensured changes were written into shadow_config, & reset config
and ensured that the default settings were restored.
DEPLOY=afe,apache
CQ-DEPEND=CL:212322
CQ-DEPEND=CL:212323
CQ-DEPEND=CL:212295
Change-Id: Ie354a2df310393045f3116e93004f58ea671de36
Reviewed-on: https://chromium-review.googlesource.com/209685
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
diff --git a/server/cros/moblab_test.py b/server/cros/moblab_test.py
index b2c0a95..7a83fdf 100644
--- a/server/cros/moblab_test.py
+++ b/server/cros/moblab_test.py
@@ -12,7 +12,6 @@
DEFAULT_IMAGE_STORAGE_SERVER = global_config.global_config.get_config_value(
'CROS', 'image_storage_server')
-MOBLAB_BOTO_FILE_DEST = '/home/moblab/.boto'
STORAGE_SERVER_REGEX = 'gs://.*/'
@@ -52,8 +51,9 @@
boto_path = os.path.join(os.getenv('HOME'), '.boto')
if not os.path.exists(boto_path):
raise error.TestError('Boto File:%s does not exist.' % boto_path)
- self._host.send_file(boto_path, MOBLAB_BOTO_FILE_DEST)
- self._host.run('chown moblab:moblab %s' % MOBLAB_BOTO_FILE_DEST)
+ self._host.send_file(boto_path, moblab_host.MOBLAB_BOTO_LOCATION)
+ self._host.run('chown moblab:moblab %s' %
+ moblab_host.MOBLAB_BOTO_LOCATION)
def set_image_storage_server(self, image_storage_server):