feat(hftest): macro to declare a long running test with precondition

This patch provides a macro to declare a long running test with a
precondition function.

One of the existing test, disallow_migration_blocked_sp, needs longer
time to run on some aarch64 developer machines as it has explicit
wait time to allow for call chain to be established on boot CPU.

Hence, this test now leverages the newly introduced test macro. Also,
the timeout for long running tests has been increased to 100s.

Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: I93e536b95601adb4a342207046d2242fe7cd7395
diff --git a/test/hftest/hftest.py b/test/hftest/hftest.py
index cf24a94..dac74e1 100755
--- a/test/hftest/hftest.py
+++ b/test/hftest/hftest.py
@@ -345,7 +345,7 @@
             debug = False, show_output = False):
         """Generate command line arguments for FVP."""
         show_output = debug or show_output
-        time_limit = "80s" if is_long_running else "40s"
+        time_limit = "100s" if is_long_running else "40s"
         fvp_args = []
 
         if not show_output:
diff --git a/test/inc/test/hftest.h b/test/inc/test/hftest.h
index 3e06b86..3fd34f2 100644
--- a/test/inc/test/hftest.h
+++ b/test/inc/test/hftest.h
@@ -43,6 +43,13 @@
 #define TEST_PRECONDITION(suite, test, precon_fn) \
 	HFTEST_TEST(suite, test, false, precon_fn)
 
+/*
+ * Define a long-running test as part of a test suite and add a precondition
+ * function.
+ */
+#define TEST_PRECONDITION_LONG_RUNNING(suite, test, precon_fn) \
+	HFTEST_TEST(suite, test, true, precon_fn)
+
 /* Define a test voluntarily skipped from the test suite. */
 #define TEST_SKIP(suite, test)                       \
 	static bool precon_skip_##suite_##test(void) \
diff --git a/test/vmapi/ffa_secure_partitions/dir_msg.c b/test/vmapi/ffa_secure_partitions/dir_msg.c
index f8c126e..0f43166 100644
--- a/test/vmapi/ffa_secure_partitions/dir_msg.c
+++ b/test/vmapi/ffa_secure_partitions/dir_msg.c
@@ -141,8 +141,8 @@
  * to a different physical CPU while the vCPU is in BLOCKED state as part of an
  * SP call chain.
  */
-TEST_PRECONDITION(ffa_call_chain, disallow_migration_blocked_sp,
-		  service2_is_up_sp)
+TEST_PRECONDITION_LONG_RUNNING(ffa_call_chain, disallow_migration_blocked_sp,
+			       service2_is_up_sp)
 {
 	struct ffa_value res;
 	ffa_id_t own_id = hf_vm_get_id();