BL2: Align BL2 test with BL2

Disable BL2 test when BL2 is not enabled.

Signed-off-by: Jianliang Shen <jianliang.shen@arm.com>
Change-Id: I07cec8aab27c30011295963050d3c9e53128b428
diff --git a/lava_helper/lava_helper_configs.py b/lava_helper/lava_helper_configs.py
index fab385b..fea1161 100644
--- a/lava_helper/lava_helper_configs.py
+++ b/lava_helper/lava_helper_configs.py
@@ -98,7 +98,7 @@
     "monitors": {
         'no_reg_tests': [monitors_no_reg_tests],
         # FPU test on FPGA not supported yet
-        'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests] if 'FPON' not in os.getenv("EXTRA_PARAMS") else [],
+        'reg_tests': ([monitors_s_reg_tests, monitors_ns_reg_tests] if 'FPON' not in os.getenv("EXTRA_PARAMS") else []) + ([monitors_mcuboot_tests] if os.getenv("BL2") == "Ture" else []),
         'arch_tests': [monitors_arch_tests] if os.getenv("TEST_PSA_API") != "IPC" else [], # FF test on FPGA not supported in LAVA yet
     }
 }
@@ -122,7 +122,7 @@
     },
     "monitors": {
         'no_reg_tests': [monitors_no_reg_tests],
-        'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
+        'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests] + ([monitors_mcuboot_tests] if os.getenv("BL2") == "Ture" else []),
     }
 }
 
@@ -146,7 +146,7 @@
     },
     "monitors": {
         'no_reg_tests': [monitors_no_reg_tests],
-        'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
+        'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests] + ([monitors_mcuboot_tests] if os.getenv("BL2") == "Ture" else []),
         'arch_tests': [monitors_arch_tests],
     }
 }
@@ -172,7 +172,7 @@
     },
     "monitors": {
         'no_reg_tests': [monitors_no_reg_tests],
-        'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
+        'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests] + ([monitors_mcuboot_tests] if os.getenv("BL2") == "Ture" else []),
     }
 }
 
@@ -193,7 +193,7 @@
     },
     "monitors": {
         # FPU test on AN521 qemu not supported yet
-        'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests] if 'FPON' not in os.getenv("EXTRA_PARAMS") else [],
+        'reg_tests': ([monitors_s_reg_tests, monitors_ns_reg_tests] if 'FPON' not in os.getenv("EXTRA_PARAMS") else []) + ([monitors_mcuboot_tests] if os.getenv("BL2") == "Ture" else []),
     }
 }
 
@@ -215,7 +215,7 @@
     },
     "monitors": {
         'no_reg_tests': [monitors_no_reg_tests],
-        'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
+        'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests] + ([monitors_mcuboot_tests] if os.getenv("BL2") == "Ture" else []),
     }
 }
 
@@ -233,7 +233,7 @@
         "tarball": "stm32l562e-dk-tfm.tar.bz2",
     },
     "monitors": {
-        'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
+        'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests] + ([monitors_mcuboot_tests] if os.getenv("BL2") == "Ture" else []),
     }
 }