faft: Support multiple action call
We used to use lambda function to do multiple calls at once, which
causes loss in test log. Let's add support for multiple action call.
BUG=chrome-os-partner:35902
TEST=Pass firmware_ECWriteProtect and check multiple actions are
actually called.
Change-Id: I484f44a11974875f29bfd01e6544c1b0237b08eb
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37347
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
diff --git a/server/cros/faftsequence.py b/server/cros/faftsequence.py
index 3cea48e..63d0fcf 100644
--- a/server/cros/faftsequence.py
+++ b/server/cros/faftsequence.py
@@ -1210,6 +1210,9 @@
action_tuple: A function, or a tuple (function, args, error_msg),
in which, args and error_msg are optional. args is
either a value or a tuple if multiple arguments.
+ This can also be a list containing multiple function
+ or tuple. In this case, these actions are called in
+ sequence.
check_status: Check the return value of action function. If not
succeed, raises a TestFail exception.
@@ -1220,6 +1223,10 @@
error.TestError: An error when the action function is not callable.
error.TestFail: When check_status=True, action function not succeed.
"""
+ if isinstance(action_tuple, list):
+ return all([self._call_action(action, check_status=check_status)
+ for action in action_tuple])
+
action = action_tuple
args = ()
error_msg = 'Not succeed'