LAVA: Align monitor settings between QEMU & FVP

The different setings on LAVA monitors between QEMU & FVP make it
possible to get different test results with same image.

This patch updates the monitor settings for QEMU to align with FVP to
avoid this issue.

Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com>
Change-Id: Id3a3ec6db382c1c3183b61e5a2ea9570c17f6ecb
diff --git a/lava_helper/jinja2_templates/qemu_mps2_bl2.jinja2 b/lava_helper/jinja2_templates/qemu_mps2_bl2.jinja2
index 6631124..e7c7a54 100644
--- a/lava_helper/jinja2_templates/qemu_mps2_bl2.jinja2
+++ b/lava_helper/jinja2_templates/qemu_mps2_bl2.jinja2
@@ -9,23 +9,27 @@
     images:
       mcuboot: {image_arg: '-device loader,file={mcuboot},addr=0x10000000', url: '{{ bootloader_url }}'}
       tfm: {image_arg: '-device loader,file={tfm},addr=0x10080000', url: '{{ firmware_url }}'}
-    timeout: {seconds: 100}
     to: tmpfs
 - boot:
     docker: {binary: /usr/bin/qemu-system-arm, image: 'trustedfirmware/ci-amd64-tf-m-qemu-debian:bullseye'}
     method: qemu
-    timeout: {seconds: 300}
+    timeout:
+      minutes: 10
 - test:
     monitors:
-    - name: wait-finish
-      start: "Non-Secure system starting"
-      end: "End of Non-secure test suites"
-      pattern: "[\x1b]\\[37mTest suite '(?P<test_case_id>.*?)' has [\x1b]\\[32m (?P<result>PASSED|FAILED)"
+    {%- for monitor in test.monitors %}
+    - name: "{{monitor.name}}"
+      start: "{{monitor.start}}"
+      end: "{{monitor.end}}"
+      pattern: "{{monitor.pattern}}"
       fixupdict:
-        PASSED: pass
-        FAILED: fail
-        SKIPPED: skip
-    timeout: {seconds: 300}
+         '{{monitor.fixup.pass}}': pass
+         '{{monitor.fixup.fail}}': fail
+         {%- if monitor.fixup.skip %}
+         '{{monitor.fixup.skip}}': skip
+         {%- endif %}
+         'SIM ERROR': fail
+    {%- endfor %}
 
 context:
   arch: arm
@@ -39,11 +43,20 @@
 device_type: {{ device_type }}
 job_name: {{ job_name }}
 priority: medium
-timeouts:
-  action: {seconds: 300}
-  job: {seconds: 300}
 visibility: public
 
+timeouts:
+  job:
+    minutes: {{ job_timeout }}
+  action:
+    minutes: {{ action_timeout }}
+  actions:
+    power-off:
+      minutes: {{ poweroff_timeout }}
+  connections:
+    lava-test-monitor:
+      minutes: {{ monitor_timeout }}
+
 metadata:
   build_no: {{ build_no }}
   compiler: {{ compiler }}
diff --git a/lava_helper/lava_helper_configs.py b/lava_helper/lava_helper_configs.py
index d1de754..80bacd6 100644
--- a/lava_helper/lava_helper_configs.py
+++ b/lava_helper/lava_helper_configs.py
@@ -606,9 +606,10 @@
     "templ": "qemu_mps2_bl2.jinja2",
     "job_name": "qemu_mps2_bl2",
     "device_type": "qemu",
-    "job_timeout": 300,
-    "action_timeout": 300,
-    "poweroff_timeout": 20,
+    "job_timeout": 15,
+    "action_timeout": 10,
+    "monitor_timeout": 15,
+    "poweroff_timeout": 1,
     "platforms": {"AN521": ""},
     "compilers": ["GCC", "ARMCLANG"],
     "build_types": ["Debug", "Release"],