| # Copyright 2023 The ChromiumOS Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| AUTHOR = 'Chromium OS team' |
| NAME = 'tast.cellular_ota_flaky-starfish' |
| METADATA = { |
| "contacts": ["chromeos-cellular-team@google.com"], |
| "bug_component": "b:167157", # ChromeOS > Platform > Connectivity > Cellular |
| } |
| TIME = 'MEDIUM' |
| TEST_TYPE = 'Server' |
| ATTRIBUTES = 'suite:cellular_ota_flaky' |
| MAX_RESULT_SIZE_KB = 1024 * 1024 |
| PY_VERSION = 3 |
| DEPENDENCIES = "carrier:starfish" |
| |
| DOC = ''' |
| Run the stable Tast tests which verify basic Cellular functionality. |
| |
| "group:cellular" indicates that the test runs on DUTs with a Cellular modem. |
| "cellular_sim_active": Used to select tests that require a sim card. |
| |
| Tast is an integration-testing framework analagous to the test-running portion |
| of Autotest. See https://chromium.googlesource.com/chromiumos/platform/tast/ for |
| more information. |
| |
| See http://go/tast-failures for information about investigating failures. |
| ''' |
| |
| import json |
| import tempfile |
| import yaml |
| from autotest_lib.client.common_lib import error |
| from autotest_lib.client.cros.cellular import labels_utils |
| |
| def run(machine): |
| host = hosts.create_host(machine) |
| labels = host.host_info_store.get().labels |
| stress_testlist=[ |
| 'cellular.ShillEnableAndConnect', |
| 'cellular.HostStressEnableDisable', |
| 'cellular.ModemmanagerEnableAndConnect', |
| 'cellular.ShillSafetyDance', |
| 'cellular.ModemSSRVerification', |
| 'cellular.ModemRebootVerification', |
| ] |
| slots = labels_utils.parse_starfish_slot_labels(labels) |
| for (index, carrier) in slots: |
| with tempfile.NamedTemporaryFile(suffix='.yaml', mode='w+') as temp_file: |
| svars = ['starfish.type=starfishplus',f'starfish.carrier={carrier}',f'starfish.index={index}'] |
| yaml.safe_dump({'autotest_host_info_labels': |
| json.dumps(labels)}, |
| stream=temp_file) |
| temp_file.flush() |
| testgroups = { |
| "0_flaky_e2e":['("group:cellular" && "cellular_sim_active" && "cellular_unstable" && "cellular_e2e" && (!"cellular_carrier_dependent" || "cellular_carrier_'+carrier+'"))'], |
| "1_flaky_platform":['("group:cellular" && "cellular_sim_active" && "cellular_unstable" && !"cellular_run_isolated" && !"cellular_e2e" && !"cellular_sms")'], |
| "2_flaky_stress":stress_testlist, |
| "3_flaky_suspend_resume":['("group:cellular" && "cellular_sim_active" && "cellular_unstable" && "cellular_suspend")'], |
| } |
| if (carrier in ['docomo', 'softbank', 'tmobile']): |
| testgroups["4_flaky_hotspot"]=[ |
| 'network.HotspotUpdateConfiguration.'+carrier, |
| 'network.HotspotUpdateConfigurationWhenHotspotOn.'+carrier, |
| 'network.HotspotAutoDisable.'+carrier, |
| 'network.HotspotDisabledWhenNoUpstreamNetwork.'+carrier, |
| 'network.HotspotEnableDisableInLockScreen.'+carrier, |
| 'network.HotspotPolicy.'+carrier, |
| 'network.HotspotAbortEnable.'+carrier |
| ] |
| |
| host.reboot() |
| for testsession in sorted(testgroups): |
| sessiontag = testsession+"_"+carrier |
| tast_test_expr = testgroups[testsession] |
| job.run_test('tast', |
| host=host, |
| test_exprs=tast_test_expr, |
| clear_tpm = False, |
| ignore_test_failures=True, max_run_sec=10800, |
| command_args=args, |
| varsfiles=[temp_file.name], |
| varslist=svars, |
| tag=sessiontag) |
| job.clear_post_run_hooks() |
| |
| parallel_simple(run, machines) |