| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import httplib | 5 import httplib |
| 6 import logging | 6 import logging |
| 7 import re | 7 import re |
| 8 import socket | 8 import socket |
| 9 import urlparse | 9 import urlparse |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 if status != UPDATER_NEED_REBOOT: | 110 if status != UPDATER_NEED_REBOOT: |
| 111 raise ChromiumOSError('update-engine error on %s: ' | 111 raise ChromiumOSError('update-engine error on %s: ' |
| 112 '"%s" from update-engine' % | 112 '"%s" from update-engine' % |
| 113 (self.host.hostname, status)) | 113 (self.host.hostname, status)) |
| 114 | 114 |
| 115 # Attempt dev & test tools update (which don't live on the | 115 # Attempt dev & test tools update (which don't live on the |
| 116 # rootfs). This must succeed so that the newly installed host | 116 # rootfs). This must succeed so that the newly installed host |
| 117 # is testable after we run the autoupdater. | 117 # is testable after we run the autoupdater. |
| 118 statefuldev_url = self.update_url.replace('update', 'static/archive') | 118 statefuldev_url = self.update_url.replace('update', 'static/archive') |
| 119 | 119 |
| 120 # --stateful_change=clean tells the updater to reset the stateful | 120 statefuldev_cmd = ' '.join([STATEFULDEV_UPDATER, statefuldev_url, |
| 121 # partition to factory state; giving us a clean slate for testing. | |
| 122 statefuldev_cmd = ' '.join([STATEFULDEV_UPDATER, | |
| 123 '--stateful_change=clean', | |
| 124 statefuldev_url, | |
| 125 '2>&1']) | 121 '2>&1']) |
| 126 logging.info(statefuldev_cmd) | 122 logging.info(statefuldev_cmd) |
| 127 try: | 123 try: |
| 128 self._run(statefuldev_cmd, timeout=600) | 124 self._run(statefuldev_cmd, timeout=600) |
| 129 except error.AutoservRunError, e: | 125 except error.AutoservRunError, e: |
| 130 # TODO(seano): If statefuldev update failed, we must mark | 126 # TODO(seano): If statefuldev update failed, we must mark |
| 131 # the update as failed, and keep the same rootfs after | 127 # the update as failed, and keep the same rootfs after |
| 132 # reboot. | 128 # reboot. |
| 133 self.revert_boot_partition() | 129 self.revert_boot_partition() |
| 134 raise ChromiumOSError('stateful_update failed on %s.' % | 130 raise ChromiumOSError('stateful_update failed on %s.' % |
| (...skipping 30 matching lines...) Expand all Loading... |
| 165 builder_num = '-b%s' % build_match.group(1) | 161 builder_num = '-b%s' % build_match.group(1) |
| 166 else: | 162 else: |
| 167 builder_num = '' | 163 builder_num = '' |
| 168 return '%s-r%s%s' % (version, build_id, builder_num) | 164 return '%s-r%s%s' % (version, build_id, builder_num) |
| 169 | 165 |
| 170 | 166 |
| 171 def get_dev_build_id(self): | 167 def get_dev_build_id(self): |
| 172 """Pulls the CHROMEOS_RELEASE_VERSION string from /etc/lsb-release.""" | 168 """Pulls the CHROMEOS_RELEASE_VERSION string from /etc/lsb-release.""" |
| 173 return self._run('grep CHROMEOS_RELEASE_VERSION' | 169 return self._run('grep CHROMEOS_RELEASE_VERSION' |
| 174 ' /etc/lsb-release').stdout.split('=')[1].strip() | 170 ' /etc/lsb-release').stdout.split('=')[1].strip() |
| OLD | NEW |