Catch connection.Error in WifiPreTest.setup_openwrt_connection()
connection.Error is raised when the connection to the OpenWrt device fails. This error should be caught and handled in the same way as other connection errors.
Recently, I see WifiPreTest failure because of uncaught error:
File "/usr/local/google/mobileharness/mh_lab_tmp/mh_lab_gen_files/031fd817-fdff-4474-9d63-ee80e8157fc6/test_1eec9d0f-ff32-4eb5-8ec3-39ed972f25ae/env/lib/python3.10/site-packages/acts-0.9-py3.10.egg/acts/controllers/utils_lib/ssh/connection.py", line 278, in run
raise Error('The job failed for unknown reasons.', result)
acts.controllers.utils_lib.ssh.connection.Error: ('The job failed for unknown reasons.', job.Result(command=['/usr/bin/ssh', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-o', 'ConnectTimeout=30', '-o', 'ServerAliveInterval=300', '-o', 'BatchMode=yes', '-a', '-x', '-p', '22', '-i', 'id_rsa_xxx', 'root@xxx', ' echo "CONNECTED: yyy"; ls /etc | grep dirty_configs;'], stdout=b'', stderr=b'ssh: connect to host xxx port 22: No route to host\r\n', exit_status=255, duration=3.118319511413574, did_timeout=False, encoding='utf-8'))
2024-10-13 19:25:08.620 INFO [Test Case] test_connects_all_testbed_wifi_networks ERROR [base_test.py:_on_skip:442]
2024-10-13 19:25:08.621 INFO Reason to skip: Failed class setup [base_test.py:_on_skip:443]
Change-Id: I8ad027e0f5e86e253a0de76abc4239d7994df049
1 file changed