1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 AUTHOR = 'The Chromium OS Authors' 6 DOC = """ 7 This test puts the network interfaces through hundred(s) of 8 connect/disconnect cycles and verifies that flimflam properly detects 9 that the service is either in online or portal state. 10 11 Use test_that with --args=service_name=cell to test the 12 portal code on cellular devices. 13 """ 14 NAME = 'network_PortalStress' 15 PURPOSE = 'Stress test the portal detection code.' 16 CRITERIA = """ 17 Fails if portal code detects portal state when 18 clients3.google.com is accessible or if portal code detects online 19 when clients3.google.com is not accessible. 20 """ 21 TIME = 'LONG' 22 TEST_CATEGORY = 'Stress' 23 TEST_CLASS = 'network' 24 TEST_TYPE = 'client' 25 26 import logging 27 logging.info('args = %s' % args) 28 29 if args: 30 args = args[0].split(':') 31 32 if args: 33 dict_args = dict([x.split('=') for x in args]) 34 else: 35 dict_args = {} 36 37 # Run online cycle for hundred(s) of iterations because this is fast 38 job.run_test('network_Portal', 39 force_portal=False, tag='online', test_iterations=100, **dict_args) 40 41 # Run the portal cycle for fewer iterations because each test must time 42 # out and that makes it exceedingly slow (15 seconds/iteration) 43 job.run_test('network_Portal', 44 force_portal=True, tag='portal', test_iterations=20, **dict_args) 45