New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 846130 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

firmware_WriteProtect throws exception: "object has no attribute '_original_wp'"

Project Member Reported by djkurtz@chromium.org, May 23 2018

Issue description

Chrome OS Version: R68-10702.0.0
Chrome OS Platform: grunt

Steps To Reproduce:
(1) test_that --fast -b grunt ${IP} firmware_WriteProtect
(2)
(3)

Expected Result:

No exception about '_original_wp'.

Actual Result:

05/22 17:23:33.917 INFO | test_runner_utils:0259| autoserv| Installing autotest on ${IP}
05/22 17:23:33.934 INFO | test_runner_utils:0259| autoserv| Master ssh connection to ${IP} is down.
05/22 17:23:34.937 INFO | test_runner_utils:0259| autoserv| Starting master ssh connection '/usr/bin/ssh -a -x -N -o ControlMaster=yes -o ControlPath=/tmp/_autotmp_CmfpWxssh-master/socket -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes -o ConnectTimeout=30 -o ServerAliveInterval=900 -o ServerAliveCountMax=3 -o ConnectionAttempts=4 -o Protocol=2 -l root -p 22 ${IP}'
05/22 17:23:40.000 INFO | test_runner_utils:0259| autoserv| Timed out waiting for master-ssh connection to be established.
05/22 17:24:44.653 INFO | test_runner_utils:0259| autoserv| Master ssh connection to ${IP} is down.
05/22 17:24:44.655 INFO | test_runner_utils:0259| autoserv| Starting master ssh connection '/usr/bin/ssh -a -x -N -o ControlMaster=yes -o ControlPath=/tmp/_autotmp_Jnk6eussh-master/socket -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes -o ConnectTimeout=30 -o ServerAliveInterval=900 -o ServerAliveCountMax=3 -o ConnectionAttempts=4 -o Protocol=2 -l root -p 22 ${IP}'
05/22 17:24:49.716 INFO | test_runner_utils:0259| autoserv| Timed out waiting for master-ssh connection to be established.
05/22 17:25:54.283 INFO | test_runner_utils:0259| autoserv| Master ssh connection to ${IP} is down.
05/22 17:25:54.284 INFO | test_runner_utils:0259| autoserv| Starting master ssh connection '/usr/bin/ssh -a -x -N -o ControlMaster=yes -o ControlPath=/tmp/_autotmp_kO0Jepssh-master/socket -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes -o ConnectTimeout=30 -o ServerAliveInterval=900 -o ServerAliveCountMax=3 -o ConnectionAttempts=4 -o Protocol=2 -l root -p 22 ${IP}'
05/22 17:25:59.345 INFO | test_runner_utils:0259| autoserv| Timed out waiting for master-ssh connection to be established.
05/22 17:27:03.919 INFO | test_runner_utils:0259| autoserv| Master ssh connection to ${IP} is down.
05/22 17:27:03.921 INFO | test_runner_utils:0259| autoserv| Starting master ssh connection '/usr/bin/ssh -a -x -N -o ControlMaster=yes -o ControlPath=/tmp/_autotmp_FdkXpTssh-master/socket -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes -o ConnectTimeout=30 -o ServerAliveInterval=900 -o ServerAliveCountMax=3 -o ConnectionAttempts=4 -o Protocol=2 -l root -p 22 ${IP}'
05/22 17:27:08.988 INFO | test_runner_utils:0259| autoserv| Timed out waiting for master-ssh connection to be established.
05/22 17:28:13.533 INFO | test_runner_utils:0259| autoserv| The test failed with the following exception
05/22 17:28:13.534 INFO | test_runner_utils:0259| autoserv| Traceback (most recent call last):
05/22 17:28:13.534 INFO | test_runner_utils:0259| autoserv| File "/build/grunt/usr/local/build/autotest/client/common_lib/test.py", line 598, in _exec
05/22 17:28:13.535 INFO | test_runner_utils:0259| autoserv| _cherry_pick_call(self.initialize, *args, **dargs)
05/22 17:28:13.535 INFO | test_runner_utils:0259| autoserv| File "/build/grunt/usr/local/build/autotest/client/common_lib/test.py", line 746, in _cherry_pick_call
05/22 17:28:13.535 INFO | test_runner_utils:0259| autoserv| return func(*p_args, **p_dargs)
05/22 17:28:13.536 INFO | test_runner_utils:0259| autoserv| File "/build/grunt/usr/local/build/autotest/server/site_tests/firmware_WriteProtect/firmware_WriteProtect.py", line 18, in initialize
05/22 17:28:13.536 INFO | test_runner_utils:0259| autoserv| super(firmware_WriteProtect, self).initialize(host, cmdline_args)
05/22 17:28:13.537 INFO | test_runner_utils:0259| autoserv| File "/build/grunt/usr/local/build/autotest/server/cros/faft/firmware_test.py", line 134, in initialize
05/22 17:28:13.537 INFO | test_runner_utils:0259| autoserv| if not self.faft_client.system.dev_tpm_present():
05/22 17:28:13.538 INFO | test_runner_utils:0259| autoserv| File "/build/grunt/usr/local/build/autotest/server/cros/faft/rpc_proxy.py", line 33, in __call__
05/22 17:28:13.538 INFO | test_runner_utils:0259| autoserv| return self.__call_method(self.__name, *args, **dargs)

05/22 17:28:13.539 INFO | test_runner_utils:0259| autoserv| File "/build/grunt/usr/local/build/autotest/server/cros/faft/rpc_proxy.py", line 78, in __call_faft_client
05/22 17:28:13.539 INFO | test_runner_utils:0259| autoserv| self.connect()
05/22 17:28:13.539 INFO | test_runner_utils:0259| autoserv| File "/build/grunt/usr/local/build/autotest/server/cros/faft/rpc_proxy.py", line 85, in connect
05/22 17:28:13.540 INFO | test_runner_utils:0259| autoserv| autotest.Autotest(self._client).install()
05/22 17:28:13.540 INFO | test_runner_utils:0259| autoserv| File "/build/grunt/usr/local/build/autotest/server/autotest.py", line 259, in install
05/22 17:28:13.541 INFO | test_runner_utils:0259| autoserv| self._install(host=host, autodir=autodir, use_packaging=use_packaging)
05/22 17:28:13.541 INFO | test_runner_utils:0259| autoserv| File "/build/grunt/usr/local/build/autotest/server/autotest.py", line 338, in _install
05/22 17:28:13.541 INFO | test_runner_utils:0259| autoserv| autodir = self.get_install_dir(host)
05/22 17:28:13.542 INFO | test_runner_utils:0259| autoserv| File "/build/grunt/usr/local/build/autotest/server/autotest.py", line 156, in get_install_dir
05/22 17:28:13.542 INFO | test_runner_utils:0259| autoserv| install_dir = cls._find_installable_dir(host)
05/22 17:28:13.543 INFO | test_runner_utils:0259| autoserv| File "/build/grunt/usr/local/build/autotest/server/autotest.py", line 178, in _find_installable_dir
05/22 17:28:13.543 INFO | test_runner_utils:0259| autoserv| ', '.join(client_autodir_paths))
05/22 17:28:13.544 INFO | test_runner_utils:0259| autoserv| AutoservInstallError: Unable to find a place to install Autotest; tried /usr/local/autotest, /usr/local/autodir
05/22 17:28:13.544 INFO | test_runner_utils:0259| autoserv| Caught exception: 'firmware_WriteProtect' object has no attribute '_original_wp'



The issue here seems to be that if the autotest server fails to connect, firmware_WriteProtect's cleanup handler will be called without first calling initialize, which means the firmware_WriteProtect object has not yet had an '_original_wp' attribute set.
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 25 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/8c7be1d80c4062f59999e4dd6989a85ba866e44e

commit 8c7be1d80c4062f59999e4dd6989a85ba866e44e
Author: Daniel Kurtz <djkurtz@chromium.org>
Date: Fri May 25 02:30:18 2018

faft: Only restore original wp if initialize ran

If the autotest server cannot make contact with the DUT, the autotest
framework will end up calling the test's cleanup without first calling
initialize.  Thus, attribute _original_wp is not yet added to
firmware_WriteProtect, leading to an exception:
  Caught exception: 'firmware_WriteProtect' object has no attribute '_original_wp'

BUG= chromium:846130 
TEST=test_that --fast -b grunt ${IP} firmware_WriteProtect
 => No errors like:
  Caught exception: 'firmware_WriteProtect' object has no attribute '_original_wp'

Change-Id: Ida1d39c6d86679ff41467e0366cd9d919abeefcb
Reviewed-on: https://chromium-review.googlesource.com/1071002
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>

[modify] https://crrev.com/8c7be1d80c4062f59999e4dd6989a85ba866e44e/server/site_tests/firmware_WriteProtect/firmware_WriteProtect.py

Status: Verified (was: Started)

Sign in to add a comment