faft: Add new control files for firmware_ccd

Support several new combinations of tast firmware attributes which have
DEPENDENCIES=servo_component:ccd_cr50

* firmware_unstable && firmware_ccd
* firmware_slow && firmware_ccd
* firmware_ec && firmware_ccd
* firmware_ccd

And then make sure that the unstable, slow, and ec files don't include
firmware_ccd.

BUG=b:187410710
TEST=test_that --board=${BOARD?} --model=${MODEL?} \
  --args="tast.firmware.hibernate_time=7m" ${DUT_HOSTNAME?} \
  tast.firmware-unstable_ccd
test_that --board=${BOARD?} --model=${MODEL?} \
  --args="tast.firmware.hibernate_time=7m" ${DUT_HOSTNAME?} \
  tast.firmware-unstable

Change-Id: I548beddf3c49079a40e6ba8662e3f29032929291
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/3021504
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Katherine Threlkeld <kathrelkeld@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
diff --git a/server/site_tests/tast/control.firmware-ccd b/server/site_tests/tast/control.firmware-ccd
index b62a52b..8783523 100644
--- a/server/site_tests/tast/control.firmware-ccd
+++ b/server/site_tests/tast/control.firmware-ccd
@@ -32,7 +32,7 @@
 def run(machine):
     job.run_test('tast',
                  host=hosts.create_host(machine, servo_args=servo_args),
-                 test_exprs=['("group:firmware" && firmware_ccd)'],
+                 test_exprs=['("group:firmware" && firmware_ccd && !firmware_unstable && !firmware_slow)'],
                  ignore_test_failures=True, max_run_sec=10800,
                  command_args=command_args,
                  varslist=varslist)
diff --git a/server/site_tests/tast/control.firmware-ec b/server/site_tests/tast/control.firmware-ec
index ebcda7b..3300456 100644
--- a/server/site_tests/tast/control.firmware-ec
+++ b/server/site_tests/tast/control.firmware-ec
@@ -31,7 +31,7 @@
 def run(machine):
     job.run_test('tast',
                  host=hosts.create_host(machine, servo_args=servo_args),
-                 test_exprs=['("group:firmware" && firmware_ec)'],
+                 test_exprs=['("group:firmware" && firmware_ec && !firmware_ccd)'],
                  ignore_test_failures=True, max_run_sec=10800,
                  command_args=command_args,
                  varslist=varslist)
diff --git a/server/site_tests/tast/control.firmware-slow b/server/site_tests/tast/control.firmware-slow
index 78e28a7..c146a90 100644
--- a/server/site_tests/tast/control.firmware-slow
+++ b/server/site_tests/tast/control.firmware-slow
@@ -31,7 +31,7 @@
 def run(machine):
     job.run_test('tast',
                  host=hosts.create_host(machine, servo_args=servo_args),
-                 test_exprs=['("group:firmware" && firmware_slow)'],
+                 test_exprs=['("group:firmware" && firmware_slow && !firmware_ccd)'],
                  ignore_test_failures=True,
                  max_run_sec=16200, # 4h30m
                  command_args=command_args,
diff --git a/server/site_tests/tast/control.firmware-slow_ccd b/server/site_tests/tast/control.firmware-slow_ccd
new file mode 100644
index 0000000..38d920d
--- /dev/null
+++ b/server/site_tests/tast/control.firmware-slow_ccd
@@ -0,0 +1,41 @@
+# Copyright 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.
+
+from autotest_lib.client.common_lib import utils
+from autotest_lib.server.site_tests.tast import tast
+
+AUTHOR = 'Chromium OS Firmware EngProd team'
+NAME = 'tast.firmware-slow_ccd'
+TIME = 'LENGTHY'
+TEST_TYPE = 'Server'
+DEPENDENCIES = 'servo_state:WORKING, servo_component:ccd_cr50'
+ATTRIBUTES = 'suite:faft_ec, suite:faft_ec_fw_qual'
+MAX_RESULT_SIZE_KB = 1024 * 1024
+
+# tast.py uses binaries installed from autotest_server_package.tar.bz2.
+REQUIRE_SSP = True
+
+DOC = '''
+Run Tast tests that are very slow.
+
+The tests are part of 'group:firmware'. The 'firmware_slow' sub-attribute
+limits it to slow tests. The 'firmware_ccd' further limits this
+to machines attached to a servo with CCD.
+'''
+
+command_args, varslist = tast.split_arguments(args)
+args_dict = utils.args_to_dict(command_args)
+assert 'servo_state:WORKING' in DEPENDENCIES
+servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
+
+def run(machine):
+    job.run_test('tast',
+                 host=hosts.create_host(machine, servo_args=servo_args),
+                 test_exprs=['("group:firmware" && firmware_slow && firmware_ccd)'],
+                 ignore_test_failures=True,
+                 max_run_sec=16200, # 4h30m
+                 command_args=command_args,
+                 varslist=varslist)
+
+parallel_simple(run, machines)
diff --git a/server/site_tests/tast/control.firmware-unstable b/server/site_tests/tast/control.firmware-unstable
index 70b27a8..f1dc0b8 100644
--- a/server/site_tests/tast/control.firmware-unstable
+++ b/server/site_tests/tast/control.firmware-unstable
@@ -32,7 +32,7 @@
 def run(machine):
     job.run_test('tast',
                  host=hosts.create_host(machine, servo_args=servo_args),
-                 test_exprs=['("group:firmware" && firmware_unstable)'],
+                 test_exprs=['("group:firmware" && firmware_unstable && !firmware_ccd)'],
                  ignore_test_failures=True,
                  max_run_sec=16200, # 4h30m
                  command_args=command_args,
diff --git a/server/site_tests/tast/control.firmware-unstable_ccd b/server/site_tests/tast/control.firmware-unstable_ccd
new file mode 100644
index 0000000..38052b0
--- /dev/null
+++ b/server/site_tests/tast/control.firmware-unstable_ccd
@@ -0,0 +1,42 @@
+# Copyright 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.
+
+from autotest_lib.client.common_lib import utils
+from autotest_lib.server.site_tests.tast import tast
+
+AUTHOR = 'Chromium OS Firmware EngProd team'
+NAME = 'tast.firmware-unstable_ccd'
+TIME = 'LENGTHY'
+TEST_TYPE = 'Server'
+DEPENDENCIES = 'servo_state:WORKING, servo_component:ccd_cr50'
+ATTRIBUTES = 'suite:faft_unstable'
+MAX_RESULT_SIZE_KB = 1024 * 1024
+
+# tast.py uses binaries installed from autotest_server_package.tar.bz2.
+REQUIRE_SSP = True
+
+DOC = '''
+Run Tast tests for EC firmware.
+
+The tests are part of 'group:firmware'. The 'firmware_unstable'
+sub-attribute limits it to unstable tests. Once the test is stable change
+the attribute to one of the others. The 'firmware_ccd' further limits this
+to machines attached to a servo with CCD.
+'''
+
+command_args, varslist = tast.split_arguments(args)
+args_dict = utils.args_to_dict(command_args)
+assert 'servo_state:WORKING' in DEPENDENCIES
+servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
+
+def run(machine):
+    job.run_test('tast',
+                 host=hosts.create_host(machine, servo_args=servo_args),
+                 test_exprs=['("group:firmware" && firmware_unstable && firmware_ccd)'],
+                 ignore_test_failures=True,
+                 max_run_sec=16200, # 4h30m
+                 command_args=command_args,
+                 varslist=varslist)
+
+parallel_simple(run, machines)