cellular: Add test for base classes

Add tests to verify the base classes common to all cellular tests.
This will allow to separate failures that occur during the test setup
from tests that verify specific cellular behaviour.

BUG=b:180002232
TEST=Run autotest on droid and lazor and expect same failure reported
in stainless.

Cq-Depend: chromium:2690907
Change-Id: I9a6e8604d6287fd7648ea15fc6b9c07c4bcc988e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2690317
Reviewed-by: Harpreet Grewal <harpreet@chromium.org>
Tested-by: Andrew Lassalle <andrewlassalle@chromium.org>
Commit-Queue: Andrew Lassalle <andrewlassalle@chromium.org>
diff --git a/client/site_tests/cellular_ValidateTestEnvironment/cellular_ValidateTestEnvironment.py b/client/site_tests/cellular_ValidateTestEnvironment/cellular_ValidateTestEnvironment.py
new file mode 100644
index 0000000..136153c
--- /dev/null
+++ b/client/site_tests/cellular_ValidateTestEnvironment/cellular_ValidateTestEnvironment.py
@@ -0,0 +1,19 @@
+# Copyright (c) 2011 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.
+
+from autotest_lib.client.bin import test
+
+
+class cellular_ValidateTestEnvironment(test.test):
+    """
+    Verify that the test setup common to all other tests has no failures.
+    """
+    version = 1
+
+    def run_once(self, test_env):
+        """ Runs the test once """
+        with test_env:
+            self.test_env = test_env
+            # Do nothing else. This is enough to initialize and terminate the
+            # test environment.
diff --git a/client/site_tests/cellular_ValidateTestEnvironment/control b/client/site_tests/cellular_ValidateTestEnvironment/control
new file mode 100644
index 0000000..27f9fdc
--- /dev/null
+++ b/client/site_tests/cellular_ValidateTestEnvironment/control
@@ -0,0 +1,35 @@
+# Copyright (c) 2021 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 = "ChromeOS Team"
+NAME = "cellular_ValidateTestEnvironment"
+PURPOSE = "Verify that the test setup common to all other tests has no failures."
+CRITERIA = """
+    Check that no errors occur when the setup and tear down of the
+    base class CellularTestEnvironment is executed multiple times.
+"""
+TIME = "SHORT"
+TEST_CATEGORY = "Functional"
+TEST_CLASS = "network"
+TEST_TYPE = "client"
+
+DOC = """
+    Verify that the test setup common to all other tests has no failures.
+"""
+
+from autotest_lib.client.cros.cellular import test_environment
+
+ITERATIONS_PER_TEST=3
+
+test_env = test_environment.CellularTestEnvironment()
+job.run_test('cellular_ValidateTestEnvironment',
+             tag='Base',
+             test_env=test_env,
+             iterations=ITERATIONS_PER_TEST)
+
+test_env = test_environment.CellularOTATestEnvironment()
+job.run_test('cellular_ValidateTestEnvironment',
+             tag='OTA',
+             test_env=test_env,
+             iterations=ITERATIONS_PER_TEST)
diff --git a/client/site_tests/cellular_ValidateTestEnvironment/control.att b/client/site_tests/cellular_ValidateTestEnvironment/control.att
new file mode 100644
index 0000000..75efa6e
--- /dev/null
+++ b/client/site_tests/cellular_ValidateTestEnvironment/control.att
@@ -0,0 +1,37 @@
+# Copyright (c) 2021 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 = "ChromeOS Team"
+NAME = "cellular_ValidateTestEnvironment.att"
+PURPOSE = "Verify that the test setup common to all other tests has no failures."
+CRITERIA = """
+    Check that no errors occur when the setup and tear down of the
+    base class CellularTestEnvironment is executed multiple times.
+"""
+ATTRIBUTES = "suite:cellular_ota_flaky"
+TIME = "SHORT"
+TEST_CATEGORY = "Functional"
+TEST_CLASS = "network"
+TEST_TYPE = "client"
+DEPENDENCIES = "carrier:att"
+
+DOC = """
+    Verify that the test setup common to all other tests has no failures.
+"""
+
+from autotest_lib.client.cros.cellular import test_environment
+
+ITERATIONS_PER_TEST=3
+
+test_env = test_environment.CellularTestEnvironment()
+job.run_test('cellular_ValidateTestEnvironment',
+             tag='Base',
+             test_env=test_env,
+             iterations=ITERATIONS_PER_TEST)
+
+test_env = test_environment.CellularOTATestEnvironment()
+job.run_test('cellular_ValidateTestEnvironment',
+             tag='OTA',
+             test_env=test_env,
+             iterations=ITERATIONS_PER_TEST)
diff --git a/client/site_tests/cellular_ValidateTestEnvironment/control.sprint b/client/site_tests/cellular_ValidateTestEnvironment/control.sprint
new file mode 100644
index 0000000..91b0975
--- /dev/null
+++ b/client/site_tests/cellular_ValidateTestEnvironment/control.sprint
@@ -0,0 +1,37 @@
+# Copyright (c) 2021 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 = "ChromeOS Team"
+NAME = "cellular_ValidateTestEnvironment.sprint"
+PURPOSE = "Verify that the test setup common to all other tests has no failures."
+CRITERIA = """
+    Check that no errors occur when the setup and tear down of the
+    base class CellularTestEnvironment is executed multiple times.
+"""
+ATTRIBUTES = "suite:cellular_ota_flaky"
+TIME = "SHORT"
+TEST_CATEGORY = "Functional"
+TEST_CLASS = "network"
+TEST_TYPE = "client"
+DEPENDENCIES = "carrier:sprint"
+
+DOC = """
+    Verify that the test setup common to all other tests has no failures..
+"""
+
+from autotest_lib.client.cros.cellular import test_environment
+
+ITERATIONS_PER_TEST=3
+
+test_env = test_environment.CellularTestEnvironment()
+job.run_test('cellular_ValidateTestEnvironment',
+             tag='Base',
+             test_env=test_env,
+             iterations=ITERATIONS_PER_TEST)
+
+test_env = test_environment.CellularOTATestEnvironment()
+job.run_test('cellular_ValidateTestEnvironment',
+             tag='OTA',
+             test_env=test_env,
+             iterations=ITERATIONS_PER_TEST)
diff --git a/client/site_tests/cellular_ValidateTestEnvironment/control.tmobile b/client/site_tests/cellular_ValidateTestEnvironment/control.tmobile
new file mode 100644
index 0000000..d23b772
--- /dev/null
+++ b/client/site_tests/cellular_ValidateTestEnvironment/control.tmobile
@@ -0,0 +1,37 @@
+# Copyright (c) 2021 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 = "ChromeOS Team"
+NAME = "cellular_ValidateTestEnvironment.tmobile"
+PURPOSE = "Verify that the test setup common to all other tests has no failures."
+CRITERIA = """
+    Check that no errors occur when the setup and tear down of the
+    base class CellularTestEnvironment is executed multiple times.
+"""
+ATTRIBUTES = "suite:cellular_ota_flaky"
+TIME = "SHORT"
+TEST_CATEGORY = "Functional"
+TEST_CLASS = "network"
+TEST_TYPE = "client"
+DEPENDENCIES = "carrier:tmobile"
+
+DOC = """
+    Verify that the test setup common to all other tests has no failures.
+"""
+
+from autotest_lib.client.cros.cellular import test_environment
+
+ITERATIONS_PER_TEST=3
+
+test_env = test_environment.CellularTestEnvironment()
+job.run_test('cellular_ValidateTestEnvironment',
+             tag='Base',
+             test_env=test_env,
+             iterations=ITERATIONS_PER_TEST)
+
+test_env = test_environment.CellularOTATestEnvironment()
+job.run_test('cellular_ValidateTestEnvironment',
+             tag='OTA',
+             test_env=test_env,
+             iterations=ITERATIONS_PER_TEST)
diff --git a/client/site_tests/cellular_ValidateTestEnvironment/control.verizon b/client/site_tests/cellular_ValidateTestEnvironment/control.verizon
new file mode 100644
index 0000000..1cb06b0
--- /dev/null
+++ b/client/site_tests/cellular_ValidateTestEnvironment/control.verizon
@@ -0,0 +1,37 @@
+# Copyright (c) 2021 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 = "ChromeOS Team"
+NAME = "cellular_ValidateTestEnvironment.verizon"
+PURPOSE = "Verify that the test setup common to all other tests has no failures."
+CRITERIA = """
+    Check that no errors occur when the setup and tear down of the
+    base class CellularTestEnvironment is executed multiple times.
+"""
+ATTRIBUTES = "suite:cellular_ota_flaky"
+TIME = "SHORT"
+TEST_CATEGORY = "Functional"
+TEST_CLASS = "network"
+TEST_TYPE = "client"
+DEPENDENCIES = "carrier:verizon"
+
+DOC = """
+    Verify that the test setup common to all other tests has no failures.
+"""
+
+from autotest_lib.client.cros.cellular import test_environment
+
+ITERATIONS_PER_TEST=3
+
+test_env = test_environment.CellularTestEnvironment()
+job.run_test('cellular_ValidateTestEnvironment',
+             tag='Base',
+             test_env=test_env,
+             iterations=ITERATIONS_PER_TEST)
+
+test_env = test_environment.CellularOTATestEnvironment()
+job.run_test('cellular_ValidateTestEnvironment',
+             tag='OTA',
+             test_env=test_env,
+             iterations=ITERATIONS_PER_TEST)