Fixes to get ctest up and running again.

We had a major issue because the latest dev channel release pre-dates the virtio change.  Because of this, ctest was connecting to update that channel using virtio (which is unsupported for that).  This change drops a file telling the vm lib to use e1000 as before.

Also, fixed stateful change logic.

Change-Id: I394a8cece71bdd0d55efa21ba5b6d24804432c6b

BUG=chromium-os:10434
TEST=Ran it with ctest and cros_au_test_harness on images with/without the file.

Review URL: http://codereview.chromium.org/5928005
This commit is contained in:
Chris Sosa 2010-12-17 13:15:05 -08:00
parent d523d23f2e
commit 40fa0ded27
3 changed files with 43 additions and 19 deletions

View File

@ -85,14 +85,14 @@ class AUTest(object):
if self.use_delta_updates: if self.use_delta_updates:
try: try:
self.source_image = src_image self.source_image = src_image
self._UpdateImageReportError(image) self._UpdateImageReportError(image, stateful_change)
except: except:
Warning('Delta update failed, disabling delta updates and retrying.') Warning('Delta update failed, disabling delta updates and retrying.')
self.use_delta_updates = False self.use_delta_updates = False
self.source_image = '' self.source_image = ''
self._UpdateImageReportError(image) self._UpdateImageReportError(image, stateful_change)
else: else:
self._UpdateImageReportError(image) self._UpdateImageReportError(image, stateful_change)
def _UpdateImageReportError(self, image_path, stateful_change='old', def _UpdateImageReportError(self, image_path, stateful_change='old',
proxy_port=None): proxy_port=None):
@ -355,9 +355,19 @@ class AUTest(object):
self.data_size += len(data) self.data_size += len(data)
return data return data
self._AttemptUpdateWithFilter(DelayedFilter()) self._AttemptUpdateWithFilter(DelayedFilter())
def SimpleTest(self):
"""A simple update that updates the target image to itself.
We explicitly don't use test prefix so that isn't run by default. Can be
run using test_prefix option.
"""
self.PrepareBase(target_image_path)
self.UpdateImage(target_image_path)
self.VerifyImage(100)
class RealAUTest(unittest.TestCase, AUTest): class RealAUTest(unittest.TestCase, AUTest):
"""Test harness for updating real images.""" """Test harness for updating real images."""

View File

@ -22,6 +22,7 @@ from cros_build_lib import RunCommand
from cros_build_lib import Warning from cros_build_lib import Warning
_IMAGE_TO_EXTRACT = 'chromiumos_test_image.bin' _IMAGE_TO_EXTRACT = 'chromiumos_test_image.bin'
_NEW_STYLE_VERSION = '0.9.131.0'
class HTMLDirectoryParser(HTMLParser.HTMLParser): class HTMLDirectoryParser(HTMLParser.HTMLParser):
"""HTMLParser for parsing the default apache file index.""" """HTMLParser for parsing the default apache file index."""
@ -216,6 +217,13 @@ def GrabZipAndExtractImage(zip_url, download_folder, image_name) :
fh.write(zip_url) fh.write(zip_url)
fh.close() fh.close()
version = zip_url.split('/')[-2]
if not _GreaterVersion(version, _NEW_STYLE_VERSION) == version:
# If the version isn't ready for new style, touch file to use old style.
old_style_touch_path = os.path.join(download_folder, '.use_e1000')
fh = open(old_style_touch_path, 'w+')
fh.close()
def RunAUTestHarness(board, channel, latest_url_base, zip_server_base, def RunAUTestHarness(board, channel, latest_url_base, zip_server_base,
no_graphics, type, remote): no_graphics, type, remote):

View File

@ -70,11 +70,17 @@ function start_kvm() {
snapshot="-snapshot" snapshot="-snapshot"
fi fi
local net_option="-net nic,model=virtio"
if [ -f "$(dirname $1)/.use_e1000" ]; then
info "Detected older image, using e1000 instead of virtio."
net_option="-net nic,model=e1000"
fi
sudo kvm -m 1024 \ sudo kvm -m 1024 \
-vga std \ -vga std \
-pidfile "${KVM_PID_FILE}" \ -pidfile "${KVM_PID_FILE}" \
-daemonize \ -daemonize \
-net nic,model=virtio \ ${net_option} \
${nographics} \ ${nographics} \
${snapshot} \ ${snapshot} \
-net user,hostfwd=tcp::${FLAGS_ssh_port}-:22 \ -net user,hostfwd=tcp::${FLAGS_ssh_port}-:22 \