Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: common/battor/battor/battor_wrapper.py

Issue 3014563002: DO NOT SUBMIT: BattOr stress test
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/battor/battor/battor_stress_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/battor/battor/battor_wrapper.py
diff --git a/common/battor/battor/battor_wrapper.py b/common/battor/battor/battor_wrapper.py
index a05fc09dd1db87bf15352f9855c65b8b1357ae57..067402238adb12051006670f9196fce2e580b78a 100644
--- a/common/battor/battor/battor_wrapper.py
+++ b/common/battor/battor/battor_wrapper.py
@@ -201,12 +201,13 @@ class BattOrWrapper(object):
assert not self._battor_shell, 'Attempting to start running BattOr shell.'
battor_cmd = [self._battor_agent_binary]
- if self._serial_log_bucket:
- # Create and immediately close a temp file in order to get a filename
- # for the serial log.
- self._serial_log_file = tempfile.NamedTemporaryFile(delete=False)
- self._serial_log_file.close()
- battor_cmd.append('--battor-serial-log=%s' % self._serial_log_file.name)
+ # if self._serial_log_bucket:
+ # Create and immediately close a temp file in order to get a filename
+ # for the serial log.
+ self._serial_log_file = tempfile.NamedTemporaryFile(delete=False)
+ self._serial_log_file.close()
+ print "Serial log at %s" % (self._serial_log_file.name)
+ battor_cmd.append('--battor-serial-log=%s' % self._serial_log_file.name)
if self._battor_path:
battor_cmd.append('--battor-path=%s' % self._battor_path)
self._battor_shell = self._StartShellImpl(battor_cmd)
@@ -360,20 +361,21 @@ class BattOrWrapper(object):
def _UploadSerialLogToCloudStorage(self):
"""Uploads the BattOr serial log to cloud storage."""
- if not self._serial_log_file or not cloud_storage.IsNetworkIOEnabled():
- return
-
- remote_path = ('battor-serial-log-%s-%d.txt' % (
- datetime.datetime.now().strftime('%Y-%m-%d_%H-%M.txt'),
- random.randint(1, 100000)))
-
- try:
- cloud_url = cloud_storage.Insert(
- self._serial_log_bucket, remote_path, self._serial_log_file.name)
- sys.stderr.write('View BattOr serial log at %s\n' % cloud_url)
- except cloud_storage.PermissionError as e:
- logging.error('Cannot upload BattOr serial log file to cloud storage due '
- 'to permission error: %s' % e.message)
+ return False
+ # if not self._serial_log_file
+ # return
+
+ # remote_path = ('battor-serial-log-%s-%d.txt' % (
+ # datetime.datetime.now().strftime('%Y-%m-%d_%H-%M.txt'),
+ # random.randint(1, 100000)))
+
+ # try:
+ # cloud_url = cloud_storage.Insert(
+ # self._serial_log_bucket, remote_path, self._serial_log_file.name)
+ # sys.stderr.write('View BattOr serial log at %s\n' % cloud_url)
+ # except cloud_storage.PermissionError as e:
+ # logging.error('Cannot upload BattOr serial log file to cloud storage due '
+ # 'to permission error: %s' % e.message)
def GetFirmwareGitHash(self):
"""Gets the git hash for the BattOr firmware.
« no previous file with comments | « common/battor/battor/battor_stress_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698