autotest: wifi: Remove network_WiFi_SuspendStress.integration test
Suspend stress test that utilizes the servo to lid close/open to
simulate suspend if flaky and has been consistently failing on all runs.
We have other variations of the suspend stress test that use powerd_dbus
to simulate suspending the device to test the suspend / resume
functionality.
BUG=chromium:845728
TEST=Ran test again caroline in lab.
Change-Id: I36ec39822542ec17d9ff5c3dcbcec2ca2a6838df
Reviewed-on: https://chromium-review.googlesource.com/1089466
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Harpreet Grewal <harpreet@chromium.org>
Reviewed-by: Harpreet Grewal <harpreet@chromium.org>
diff --git a/server/site_tests/network_WiFi_SuspendStress/control.Integration b/server/site_tests/network_WiFi_SuspendStress/control.Integration
deleted file mode 100644
index 69c0a2d..0000000
--- a/server/site_tests/network_WiFi_SuspendStress/control.Integration
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright (c) 2015 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-AUTHOR = 'debayanb'
-NAME = 'network_WiFi_SuspendStress.integration'
-TIME = 'MEDIUM'
-TEST_TYPE = 'Server'
-DEPENDENCIES = 'servo, wificell'
-ATTRIBUTES = 'suite:wifi_endtoend'
-
-DOC = """
-This test uses servo to simulate lid close and open events and checks that the
-wifi adapter is brought back up along with client side test :dekstopSimpleUi to
-run and connects to a 802.11g & 802.11a network on channels 1,6,48, 64.
-"""
-
-from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes
-from autotest_lib.server.cros.network import hostap_config
-from autotest_lib.server import utils
-
-args_dict = utils.args_to_dict(args)
-servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
-
-def run(machine):
- try:
- host = hosts.create_host(machine, servo_args=servo_args)
- except IOError:
- # We probably failed to connect to the servo. That's probably
- # because the cell doesn't have a servo.
- #
- # Ideally, we'd raise TestNAError here, and be done. But the
- # test isn't actually running yet. So we instantiate a host
- # without servo, and let the network_WiFi_SuspendStress
- # instance report the TestNAError.
- host = hosts.create_host(machine)
-
- g_mode = hostap_config.HostapConfig.MODE_11G
- a_mode = hostap_config.HostapConfig.MODE_11A
- configurations = [(hostap_config.HostapConfig(channel=1, mode=g_mode),
- xmlrpc_datatypes.AssociationParameters()),
- (hostap_config.HostapConfig(channel=6, mode=g_mode),
- xmlrpc_datatypes.AssociationParameters()),
- (hostap_config.HostapConfig(channel=48, mode=a_mode),
- xmlrpc_datatypes.AssociationParameters()),
- (hostap_config.HostapConfig(channel=64, mode=a_mode),
- xmlrpc_datatypes.AssociationParameters())
- ]
- job.run_test('network_WiFi_SuspendStress',
- host=host,
- tag=NAME.split('.')[1],
- suspends=5,
- raw_cmdline_args=args,
- additional_params=configurations,
- integration=True)
-
-
-parallel_simple(run, machines)
diff --git a/server/site_tests/network_WiFi_SuspendStress/network_WiFi_SuspendStress.py b/server/site_tests/network_WiFi_SuspendStress/network_WiFi_SuspendStress.py
index 30c769c..8f12060 100644
--- a/server/site_tests/network_WiFi_SuspendStress/network_WiFi_SuspendStress.py
+++ b/server/site_tests/network_WiFi_SuspendStress/network_WiFi_SuspendStress.py
@@ -2,28 +2,17 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import json
-import logging
-import time
-import sys
-
-from autotest_lib.client.bin import utils
-from autotest_lib.client.common_lib import error
from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes
from autotest_lib.server.cros import stress
from autotest_lib.server.cros.network import wifi_cell_test_base
-from autotest_lib.server.cros.multimedia import remote_facade_factory
_DELAY = 10
_START_TIMEOUT_SECONDS = 20
class network_WiFi_SuspendStress(wifi_cell_test_base.WiFiCellTestBase):
- """
- 1. If the control file is control.integration, the test uses servo to
- repeatedly close & open lid while running BrowserTests.
- 2. Any other control file , the test suspend and resume with powerd_dbus
- command and assert wifi connectivity to router.
+ """Test suspend and resume with powerd_dbus_suspend command and assert wifi
+ connectivity to router.
"""
version = 1
@@ -38,73 +27,23 @@
self._configurations = additional_params
- def logged_in(self):
- """Checks if the host has a logged in user.
-
- @return True if a user is logged in on the device.
-
- """
- try:
- out = self._host.run('cryptohome --action=status').stdout
- except Exception as e:
- logging.warning('%s' % e)
- return False
- try:
- status = json.loads(out.strip())
- except ValueError:
- logging.info('Cryptohome did not return a value.')
- return False
-
- success = any((mount['mounted'] for mount in status['mounts']))
- if success:
- # Chrome needs a few moments to get ready, otherwise an immediate
- # suspend will power down the system.
- time.sleep(5)
- return success
-
-
- def check_servo_lid_open_support(self):
- """ Check if DUT supports servo lid_open/close. Ref:http://b/37436993"""
- try:
- self._host.servo.lid_close()
- self._host.servo.lid_open()
- except AssertionError:
- raise error.TestNAError('Error setting lid_open status. '
- 'Skipping test run on this board. %s.'
- % sys.exc_info()[1])
-
-
- def stress_wifi_suspend(self, try_servo=True):
- """ Perform the suspend stress.
-
- @param try_servo:option to toogle use powerd vs servo_lid to suspend.
- """
- # servo might be taking time to come up; wait a bit
- if not self._host.servo and try_servo:
- time.sleep(10)
+ def stress_wifi_suspend(self):
+ """ Perform the suspend stress."""
boot_id = self._host.get_boot_id()
- if (not try_servo or
- self._host.servo.get('lid_open') == 'not_applicable'):
- self.context.client.do_suspend(_DELAY)
- else:
- self._host.servo.lid_close()
- self._host.wait_down(timeout=_DELAY)
- self._host.servo.lid_open()
- self._host.wait_up(timeout=_DELAY)
-
+ self.context.client.do_suspend(_DELAY)
self._host.test_wait_for_resume(boot_id)
state_info = self.context.wait_for_connection(
- self.context.router.get_ssid())
+ self.context.router.get_ssid())
self._timings.append(state_info.time)
- def powerd_non_servo_wifi_suspend(self):
- """ Perform the suspend stress with powerdbus."""
- self.stress_wifi_suspend(try_servo=False)
+ def run_once(self, suspends=5):
+ """Run suspend stress test.
+ @param suspends: Number of suspend iterations
- def run_once(self, suspends=5, integration=None):
+ """
self._host = self.context.client.host
for router_conf, client_conf in self._configurations:
@@ -116,33 +55,7 @@
self.context.assert_connect_wifi(assoc_params)
self._timings = list()
- if integration:
- if not self._host.servo:
- raise error.TestNAError('Servo object returned None. '
- 'Check if servo is missing or bad')
-
- # If the DUT is up and cold_reset is set to on, that means the
- # DUT does not support cold_reset. We can't run the test,
- # because it may get in a bad state and we won't be able
- # to recover.
- if self._host.servo.get('cold_reset') == 'on':
- raise error.TestNAError('This DUT does not support '
- 'cold reset, exiting')
- self.factory = remote_facade_factory.RemoteFacadeFactory(
- self._host, no_chrome=True)
- logging.info('Running Wifi Suspend Stress Integration test.')
- browser_facade = self.factory.create_browser_facade()
- browser_facade.start_default_chrome()
- utils.poll_for_condition(condition=self.logged_in,
- timeout=_START_TIMEOUT_SECONDS,
- sleep_interval=1,
- desc='User not logged in.')
- self.check_servo_lid_open_support()
- stressor = stress.CountedStressor(self.stress_wifi_suspend)
- else:
- logging.info('Running Non integration Wifi Stress test.')
- stressor = stress.CountedStressor(
- self.powerd_non_servo_wifi_suspend)
+ stressor = stress.CountedStressor(self.stress_wifi_suspend)
stressor.start(suspends)
stressor.wait()