Add a bunch of integration tests for xbuddy and autotest workflows.
This CL starts the process of adding integration testing to both the
xbuddy and lab workflows. Anyone making substantial changes to the
devserver will be required to run all of these tests (including adding
more if adding new functionality).
This CL adds testing of the following RPCs:
stage
is_staged
update
xbuddy
This CL also removes the hardcoding of 8080 and tries all ports from
8080-8090.
BUG=chromium:216959
TEST=Ran them.
Change-Id: I7a547698963e2c114c480977058059ca5d9de3ba
Reviewed-on: https://chromium-review.googlesource.com/173162
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
diff --git a/build_util.py b/build_util.py
index 82dc2df..29c408b 100644
--- a/build_util.py
+++ b/build_util.py
@@ -13,20 +13,19 @@
Classes that inherit from BuildObject can access scripts in the src/scripts
directory, and have a handle to the static directory of the devserver.
"""
- def __init__(self, root_dir, static_dir):
+ def __init__(self, static_dir):
self.devserver_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
self.static_dir = static_dir
- try:
- chroot_dir = os.environ['CROS_WORKON_SRCROOT']
- self.scripts_dir = os.path.join(chroot_dir, 'src/scripts')
- self.images_dir = os.path.join(chroot_dir, 'src/build/images')
- except KeyError:
- # Outside of chroot: This is a corner case. Since we live either in
- # platform/dev or /usr/bin/, scripts have to live in ../../../src/scripts
- self.scripts_dir = os.path.abspath(os.path.join(
- self.devserver_dir, '../../../src/scripts'))
- self.images_dir = os.path.abspath(os.path.join(
- self.devserver_dir, '../../../src/build/images'))
+ self.scripts_dir = os.path.join(self.GetSourceRoot(), 'src/scripts')
+
+ @staticmethod
+ def GetSourceRoot():
+ """Returns the path to the source root."""
+ src_root = os.environ.get('CROS_WORKON_SRCROOT')
+ if not src_root:
+ src_root = os.path.join(os.path.dirname(__file__), '..', '..', '..')
+
+ return os.path.realpath(src_root)
def GetLatestImageDir(self, board):
"""Returns the latest image dir based on shell script."""