mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 07:01:13 +02:00
Add simple update test to pfq.
This CL also fixes the outstanding issue where to won't report progress in image_to_live on updates. Change-Id: I1efaf17f0fd5ebb367ae0872377b4d5d0bf5dbf6 BUG=chromium-os:8680,chromium-os:8901 TEST=Ran it with --debug on the x86 pfq locally. Review URL: http://codereview.chromium.org/6135002
This commit is contained in:
parent
53f189e92f
commit
efbce1e261
@ -415,6 +415,22 @@ def _RunSmokeSuite(buildroot, results_dir):
|
|||||||
], cwd=cwd, error_ok=False)
|
], cwd=cwd, error_ok=False)
|
||||||
|
|
||||||
|
|
||||||
|
def _RunAUTest(buildroot, board):
|
||||||
|
"""Runs a basic update test from the au test harness."""
|
||||||
|
cwd = os.path.join(buildroot, 'src', 'scripts')
|
||||||
|
image_path = os.path.join(buildroot, 'src', 'build', 'images', board,
|
||||||
|
'latest', 'chromiumos_test_image.bin')
|
||||||
|
RunCommand(['bin/cros_au_test_harness',
|
||||||
|
'--no_graphics',
|
||||||
|
'--no_delta',
|
||||||
|
'--board=%s' % board,
|
||||||
|
'--test_prefix=SimpleTest',
|
||||||
|
'--verbose',
|
||||||
|
'--base_image=%s' % image_path,
|
||||||
|
'--target_image=%s' % image_path,
|
||||||
|
], cwd=cwd, error_ok=False)
|
||||||
|
|
||||||
|
|
||||||
def _UprevPackages(buildroot, tracking_branch, revisionfile, board, overlays):
|
def _UprevPackages(buildroot, tracking_branch, revisionfile, board, overlays):
|
||||||
"""Uprevs a package based on given revisionfile.
|
"""Uprevs a package based on given revisionfile.
|
||||||
|
|
||||||
@ -695,11 +711,12 @@ def main():
|
|||||||
|
|
||||||
_BuildImage(buildroot)
|
_BuildImage(buildroot)
|
||||||
|
|
||||||
if buildconfig['smoke_bvt'] and options.tests:
|
if buildconfig['tests'] and options.tests:
|
||||||
_BuildVMImageForTesting(buildroot)
|
_BuildVMImageForTesting(buildroot)
|
||||||
test_results_dir = '/tmp/run_remote_tests.%s' % options.buildnumber
|
test_results_dir = '/tmp/run_remote_tests.%s' % options.buildnumber
|
||||||
try:
|
try:
|
||||||
_RunSmokeSuite(buildroot, test_results_dir)
|
_RunSmokeSuite(buildroot, test_results_dir)
|
||||||
|
_RunAUTest(buildroot, buildconfig['board'])
|
||||||
finally:
|
finally:
|
||||||
if not options.debug:
|
if not options.debug:
|
||||||
archive_full_path = os.path.join(options.gsutil_archive,
|
archive_full_path = os.path.join(options.gsutil_archive,
|
||||||
|
@ -18,7 +18,7 @@ important -- Master bot uses important bots to determine overall status.
|
|||||||
hostname -- Needed for 'important' slaves. The hostname of the bot. Should
|
hostname -- Needed for 'important' slaves. The hostname of the bot. Should
|
||||||
match hostname in slaves.cfg in buildbot checkout.
|
match hostname in slaves.cfg in buildbot checkout.
|
||||||
unittests -- Runs unittests for packages.
|
unittests -- Runs unittests for packages.
|
||||||
smoke_bvt -- Runs the test smoke suite in a qemu-based VM using KVM.
|
tests -- Runs the smoke suite and au test harness in a qemu-based VM using KVM.
|
||||||
rev_overlays -- Select what overlays to look at for revving. This can be
|
rev_overlays -- Select what overlays to look at for revving. This can be
|
||||||
'public', 'private' or 'both'.
|
'public', 'private' or 'both'.
|
||||||
push_overlays -- Select what overlays to push at. This should be a subset of
|
push_overlays -- Select what overlays to push at. This should be a subset of
|
||||||
@ -35,7 +35,7 @@ config['default'] = {
|
|||||||
'master' : False,
|
'master' : False,
|
||||||
'important' : False,
|
'important' : False,
|
||||||
'unittests' : False,
|
'unittests' : False,
|
||||||
'smoke_bvt' : False,
|
'tests' : False,
|
||||||
'rev_overlays': 'public',
|
'rev_overlays': 'public',
|
||||||
'push_overlays': None,
|
'push_overlays': None,
|
||||||
}
|
}
|
||||||
@ -46,7 +46,7 @@ config['x86-generic-pre-flight-queue'] = {
|
|||||||
'important' : False,
|
'important' : False,
|
||||||
'hostname' : 'chromeosbuild2',
|
'hostname' : 'chromeosbuild2',
|
||||||
'unittests' : True,
|
'unittests' : True,
|
||||||
'smoke_bvt' : True,
|
'tests' : True,
|
||||||
'rev_overlays': 'public',
|
'rev_overlays': 'public',
|
||||||
'push_overlays': 'public',
|
'push_overlays': 'public',
|
||||||
}
|
}
|
||||||
@ -56,7 +56,7 @@ config['x86-mario-pre-flight-queue'] = {
|
|||||||
'master' : True,
|
'master' : True,
|
||||||
'important' : False,
|
'important' : False,
|
||||||
'unittests' : True,
|
'unittests' : True,
|
||||||
'smoke_bvt' : True,
|
'tests' : True,
|
||||||
'rev_overlays': 'both',
|
'rev_overlays': 'both',
|
||||||
'push_overlays': 'private',
|
'push_overlays': 'private',
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ config['x86-mario-pre-flight-branch'] = {
|
|||||||
'master' : True,
|
'master' : True,
|
||||||
'important' : False,
|
'important' : False,
|
||||||
'unittests' : True,
|
'unittests' : True,
|
||||||
'smoke_bvt' : True,
|
'tests' : True,
|
||||||
'rev_overlays': 'both',
|
'rev_overlays': 'both',
|
||||||
'push_overlays': 'both',
|
'push_overlays': 'both',
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ config['x86_agz_bin'] = {
|
|||||||
'master' : False,
|
'master' : False,
|
||||||
'important' : False,
|
'important' : False,
|
||||||
'unittests' : True,
|
'unittests' : True,
|
||||||
'smoke_bvt' : True,
|
'tests' : True,
|
||||||
'rev_overlays': 'both',
|
'rev_overlays': 'both',
|
||||||
'push_overlays': None,
|
'push_overlays': None,
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ config['x86_dogfood_bin'] = {
|
|||||||
'master' : False,
|
'master' : False,
|
||||||
'important' : False,
|
'important' : False,
|
||||||
'unittests' : True,
|
'unittests' : True,
|
||||||
'smoke_bvt' : True,
|
'tests' : True,
|
||||||
'rev_overlays': 'both',
|
'rev_overlays': 'both',
|
||||||
'push_overlays': None,
|
'push_overlays': None,
|
||||||
}
|
}
|
||||||
|
@ -358,12 +358,12 @@ class AUTest(object):
|
|||||||
self._AttemptUpdateWithFilter(DelayedFilter())
|
self._AttemptUpdateWithFilter(DelayedFilter())
|
||||||
|
|
||||||
def SimpleTest(self):
|
def SimpleTest(self):
|
||||||
"""A simple update that updates the target image to itself.
|
"""A simple update that updates once from a base image to a target.
|
||||||
|
|
||||||
We explicitly don't use test prefix so that isn't run by default. Can be
|
We explicitly don't use test prefix so that isn't run by default. Can be
|
||||||
run using test_prefix option.
|
run using test_prefix option.
|
||||||
"""
|
"""
|
||||||
self.PrepareBase(target_image_path)
|
self.PrepareBase(base_image_path)
|
||||||
self.UpdateImage(target_image_path)
|
self.UpdateImage(target_image_path)
|
||||||
self.VerifyImage(100)
|
self.VerifyImage(100)
|
||||||
|
|
||||||
|
@ -241,7 +241,6 @@ function get_update_log {
|
|||||||
echo "${REMOTE_OUT}" > "${FLAGS_update_log}"
|
echo "${REMOTE_OUT}" > "${FLAGS_update_log}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Returns ${1} reported by the update client e.g. PROGRESS, CURRENT_OP.
|
# Returns ${1} reported by the update client e.g. PROGRESS, CURRENT_OP.
|
||||||
function get_update_var {
|
function get_update_var {
|
||||||
remote_sh "${UPDATER_BIN} --status 2> /dev/null |
|
remote_sh "${UPDATER_BIN} --status 2> /dev/null |
|
||||||
@ -254,21 +253,30 @@ function get_update_var {
|
|||||||
# This is expected to run in its own thread.
|
# This is expected to run in its own thread.
|
||||||
function status_thread {
|
function status_thread {
|
||||||
local timeout=5
|
local timeout=5
|
||||||
# Let update engine receive call to ping the dev server.
|
|
||||||
info "Devserver handling ping. Check ${FLAGS_server_log} for more info."
|
info "Devserver handling ping. Check ${FLAGS_server_log} for more info."
|
||||||
sleep ${timeout}
|
sleep ${timeout}
|
||||||
|
|
||||||
# The devserver generates images when the update engine checks for updates.
|
local current_state=""
|
||||||
while [ $(get_update_var CURRENT_OP) = ${UPDATER_UPDATE_CHECK} ]; do
|
local next_state="$(get_update_var CURRENT_OP)"
|
||||||
echo -n "." && sleep ${timeout}
|
|
||||||
done
|
|
||||||
|
|
||||||
info "Update generated. Update engine downloading update."
|
# For current status, only print out status changes.
|
||||||
while [ $(get_update_var CURRENT_OP) = ${UPDATER_DOWNLOADING} ]; do
|
# For download, show progress.
|
||||||
echo "Download progress $(get_update_var PROGRESS)" && sleep ${timeout}
|
# Finally if no status change print out .'s to keep dev informed.
|
||||||
done
|
while [ "${current_state}" != "${UPDATER_NEED_REBOOT}" ] && \
|
||||||
|
[ "${current_state}" != "${UPDATER_IDLE}" ]; do
|
||||||
|
if [ "${current_state}" != "${next_state}" ]; then
|
||||||
|
info "State of updater has changed to: ${next_state}"
|
||||||
|
elif [ "${next_state}" = "${UPDATER_DOWNLOADING}" ]; then
|
||||||
|
echo "Download progress $(get_update_var PROGRESS)"
|
||||||
|
else
|
||||||
|
echo -n "."
|
||||||
|
fi
|
||||||
|
|
||||||
info "Download complete."
|
sleep ${timeout}
|
||||||
|
current_state="${next_state}"
|
||||||
|
next_state="$(get_update_var CURRENT_OP)"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user