Initial xBuddy for devserver
Contains most of the basic functionality of the xBuddy rpc, as outlined
in the Design Doc found in ChromeOs Installer.
- xbuddy, xbuddy_list, xbuddy_capacity rpcs on devserver
- xbuddy's path translation:
- defined default version aliases
- defined default xbuddy artifact aliases
- xbuddy build cache:
- on build_id cache hit, serves corresponding image/artifact
- on build_id cache miss, downloads from Google Storage, then serves
- maintains a cache of 5 downloaded builds & record of their last
access time in a separate timestamp directory
Plus some housekeeping of devserver constants
BUG=chromium:252941
TEST=manual and unit tests
Manual (for testing devserver rpcs): Run the devserver locally, attempt
to access each of the following addresses from browser
1. http://localhost:8080/xbuddy?path=/parrot-release/R21-2461.0.0/
test&return_update_url=t
Expect: Several seconds of lag as image is downloaded, then a
url to the image dir, such as
http://localhost:8080/static/parrot-release/R21-2461.0.0
[Note, using an IP address instead of localhost should return that IP
address]
2. http://localhost:8080/xbuddy?path=/parrot-release/R21-2461.0.0/test
Expect: A download of the right chromeos_test_image.bin
3. http://localhost:8080/xbuddy_capacity/
Expect: Just '5', the default xbuddy capacity
4. http://localhost:8080/xbuddy_list/
Expect: A string that lists the previously requested build and how
long ago it was accessed
5. More combinations of board/version/alias should work as well, with
xbuddy_list and the default devserver static folder's contents
reflecting normal caching behavior.
Unit Tests (for xbuddy functions): run xbuddy_unittests.py
Change-Id: I612cbb3ee907bb70907669d6db20f266157c0244
Reviewed-on: https://gerrit.chromium.org/gerrit/59287
Reviewed-by: Joy Chen <[email protected]>
Tested-by: Joy Chen <[email protected]>
Commit-Queue: Joy Chen <[email protected]>
7 files changed