summaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-bsp')
-rw-r--r--meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0001-utils.c-Prefer-monotonic-clock-to-calculate-elapsed-.patch72
-rw-r--r--meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0002-Makefile-libcheck-now-requires-to-link-subunit.patch29
-rw-r--r--meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0003-Add-support-to-avoid-load-run-twice-a-run_ptest-scri.patch137
-rw-r--r--meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0004-README.md-Update-to-my-current-email.patch29
-rw-r--r--meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0005-main.c-Use-realpath-to-get-the-actual-directory-of-p.patch42
-rw-r--r--meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0006-main.c-Add-option-e-to-exclude-certain-tests-for-exe.patch123
-rw-r--r--meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch144
-rw-r--r--meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.1.bbappend4
8 files changed, 580 insertions, 0 deletions
diff --git a/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0001-utils.c-Prefer-monotonic-clock-to-calculate-elapsed-.patch b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0001-utils.c-Prefer-monotonic-clock-to-calculate-elapsed-.patch
new file mode 100644
index 000000000..6ca593be5
--- /dev/null
+++ b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0001-utils.c-Prefer-monotonic-clock-to-calculate-elapsed-.patch
@@ -0,0 +1,72 @@
+From 41b7f4814d39c1930b1fcf0be2e247a73546fb80 Mon Sep 17 00:00:00 2001
+From: Jeffrey Pautler <jeffrey.pautler@ni.com>
+Date: Tue, 31 Oct 2017 14:38:39 -0500
+Subject: [PATCH 1/7] utils.c: Prefer monotonic clock to calculate elapsed time
+
+The current implementation uses the system clock to calculate how long
+a ptest has been running with no output. If a ptest changes the system
+clock as part of the test, that can cause the current implementation
+to falsely trigger a timeout or miss an actual timeout. It is
+preferrable to use a monotonic clock for calculating elapsed time in
+order to avoid these issues.
+
+This change tries to use the monotonic clock first and falls back to
+the realtime clock if the monotonic clock is not supported.
+
+Signed-off-by: Jeffrey Pautler <jeffrey.pautler@ni.com>
+---
+ utils.c | 24 +++++++++++++++++-------
+ 1 file changed, 17 insertions(+), 7 deletions(-)
+
+diff --git a/utils.c b/utils.c
+index 6d653887e9e4..933ecedf57e8 100644
+--- a/utils.c
++++ b/utils.c
+@@ -257,7 +257,8 @@ wait_child(const char *ptest_dir, const char *run_ptest, pid_t pid,
+ int timeout, int *fds, FILE **fps)
+ {
+ struct pollfd pfds[2];
+- time_t sentinel;
++ struct timespec sentinel;
++ clockid_t clock = CLOCK_MONOTONIC;
+ int r;
+
+ int timeouted = 0;
+@@ -269,7 +270,11 @@ wait_child(const char *ptest_dir, const char *run_ptest, pid_t pid,
+ pfds[1].fd = fds[1];
+ pfds[1].events = POLLIN;
+
+- sentinel = time(NULL);
++ if (clock_gettime(clock, &sentinel) == -1) {
++ clock = CLOCK_REALTIME;
++ clock_gettime(clock, &sentinel);
++ }
++
+ while (1) {
+ waitflags = WNOHANG;
+
+@@ -288,11 +293,16 @@ wait_child(const char *ptest_dir, const char *run_ptest, pid_t pid,
+ fwrite(buf, n, 1, fps[1]);
+ }
+
+- sentinel = time(NULL);
+- } else if (timeout >= 0 && ((time(NULL) - sentinel) > timeout)) {
+- timeouted = 1;
+- kill(pid, SIGKILL);
+- waitflags = 0;
++ clock_gettime(clock, &sentinel);
++ } else if (timeout >= 0) {
++ struct timespec time;
++
++ clock_gettime(clock, &time);
++ if ((time.tv_sec - sentinel.tv_sec) > timeout) {
++ timeouted = 1;
++ kill(pid, SIGKILL);
++ waitflags = 0;
++ }
+ }
+
+ if (waitpid(pid, &status, waitflags) == pid)
+--
+2.11.0
+
diff --git a/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0002-Makefile-libcheck-now-requires-to-link-subunit.patch b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0002-Makefile-libcheck-now-requires-to-link-subunit.patch
new file mode 100644
index 000000000..4ada99422
--- /dev/null
+++ b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0002-Makefile-libcheck-now-requires-to-link-subunit.patch
@@ -0,0 +1,29 @@
+From 4f6d6c5e3f2f181e3cc380a76e635e7c34d3c5d1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linaro.org>
+Date: Thu, 7 Dec 2017 17:42:44 -0600
+Subject: [PATCH 2/7] Makefile: libcheck now requires to link subunit
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 434b89f34688..1bde7beff9d1 100644
+--- a/Makefile
++++ b/Makefile
+@@ -22,7 +22,7 @@ TEST_SOURCES=tests/main.c tests/ptest_list.c tests/utils.c $(BASE_SOURCES)
+ TEST_OBJECTS=$(TEST_SOURCES:.c=.o)
+ TEST_EXECUTABLE=ptest-runner-test
+ TEST_LDFLAGS=-lm -lrt -lpthread
+-TEST_LIBSTATIC=-lcheck
++TEST_LIBSTATIC=-lcheck -lsubunit
+
+ TEST_DATA=$(shell echo `pwd`/tests/data)
+
+--
+2.11.0
+
diff --git a/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0003-Add-support-to-avoid-load-run-twice-a-run_ptest-scri.patch b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0003-Add-support-to-avoid-load-run-twice-a-run_ptest-scri.patch
new file mode 100644
index 000000000..47957333d
--- /dev/null
+++ b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0003-Add-support-to-avoid-load-run-twice-a-run_ptest-scri.patch
@@ -0,0 +1,137 @@
+From 0e566f65fa31eaa5208d4a17413c7a4aad7eade5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linaro.org>
+Date: Thu, 7 Dec 2017 17:42:45 -0600
+Subject: [PATCH 3/7] Add support to avoid load/run twice a run_ptest script
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In some ptest packages exists symlink in the ptest directory causing
+to load/run twice the same ptest,
+
+For example in perl5:
+
+/usr/lib/perl -> /usr/lib/perl5
+
+Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
+---
+ ptest_list.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ ptest_list.h | 3 +++
+ tests/data/python3 | 1 +
+ tests/utils.c | 1 +
+ utils.c | 6 ++++++
+ 5 files changed, 51 insertions(+)
+ create mode 120000 tests/data/python3
+
+diff --git a/ptest_list.c b/ptest_list.c
+index 2e1aa305752d..3e393d5fabe2 100644
+--- a/ptest_list.c
++++ b/ptest_list.c
+@@ -110,6 +110,46 @@ ptest_list_search(struct ptest_list *head, char *ptest)
+ return q;
+ }
+
++
++struct ptest_list *
++ptest_list_search_by_file(struct ptest_list *head, char *run_ptest, struct stat st_buf)
++{
++ struct ptest_list *q = NULL;
++ struct ptest_list *p;
++ struct stat st_buf_p;
++
++ VALIDATE_PTR_RNULL(head);
++ VALIDATE_PTR_RNULL(run_ptest);
++
++ for (p = head; p != NULL; p = p->next) {
++ if (p->ptest == NULL)
++ continue;
++
++ if (stat(p->run_ptest, &st_buf_p) == -1)
++ continue;
++
++ if (strcmp(p->run_ptest, run_ptest) == 0) {
++ q = p;
++ break;
++ }
++
++ /* *
++ * In some ptest packages exists symlink in the ptest directory
++ * causing to load/run twice the same ptest,
++ *
++ * For example in perl5:
++ * /usr/lib/perl -> /usr/lib/perl5
++ * */
++ if (st_buf.st_dev == st_buf_p.st_dev &&
++ st_buf.st_ino == st_buf_p.st_ino) {
++ q = p;
++ break;
++ }
++ }
++
++ return q;
++}
++
+ struct ptest_list *
+ ptest_list_add(struct ptest_list *head, char *ptest, char *run_ptest)
+ {
+diff --git a/ptest_list.h b/ptest_list.h
+index 8b394853c25b..03d75390a51d 100644
+--- a/ptest_list.h
++++ b/ptest_list.h
+@@ -28,6 +28,8 @@
+ #define PTEST_LIST_ITERATE_START(head, p) for (p = head->next; p != NULL; p = p->next) {
+ #define PTEST_LIST_ITERATE_END }
+
++#include <sys/stat.h>
++
+ struct ptest_list {
+ char *ptest;
+ char *run_ptest;
+@@ -42,6 +44,7 @@ extern int ptest_list_free_all(struct ptest_list *);
+
+ extern int ptest_list_length(struct ptest_list *);
+ extern struct ptest_list *ptest_list_search(struct ptest_list *, char *);
++extern struct ptest_list *ptest_list_search_by_file(struct ptest_list *, char *, struct stat);
+ extern struct ptest_list *ptest_list_add(struct ptest_list *, char *, char *);
+ extern struct ptest_list *ptest_list_remove(struct ptest_list *, char *, int);
+
+diff --git a/tests/data/python3 b/tests/data/python3
+new file mode 120000
+index 000000000000..d8654aa0e2f2
+--- /dev/null
++++ b/tests/data/python3
+@@ -0,0 +1 @@
++python
+\ No newline at end of file
+diff --git a/tests/utils.c b/tests/utils.c
+index ecf3e8af9a81..cf093793c4f2 100644
+--- a/tests/utils.c
++++ b/tests/utils.c
+@@ -48,6 +48,7 @@ static int ptests_found_length = 6;
+ static char *ptests_not_found[] = {
+ "busybox",
+ "perl",
++ "python3",
+ NULL,
+ };
+
+diff --git a/utils.c b/utils.c
+index 933ecedf57e8..ed2eff7900c1 100644
+--- a/utils.c
++++ b/utils.c
+@@ -143,6 +143,12 @@ get_available_ptests(const char *dir)
+ continue;
+ }
+
++ if (ptest_list_search_by_file(head, run_ptest, st_buf)) {
++ free(run_ptest);
++ free(d_name);
++ continue;
++ }
++
+ struct ptest_list *p = ptest_list_add(head,
+ d_name, run_ptest);
+ CHECK_ALLOCATION(p, sizeof(struct ptest_list *), 0);
+--
+2.11.0
+
diff --git a/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0004-README.md-Update-to-my-current-email.patch b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0004-README.md-Update-to-my-current-email.patch
new file mode 100644
index 000000000..dbfe648cf
--- /dev/null
+++ b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0004-README.md-Update-to-my-current-email.patch
@@ -0,0 +1,29 @@
+From 16413d71cc06b02a6d859c35a017cc49b88283f7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linaro.org>
+Date: Thu, 7 Dec 2017 17:42:46 -0600
+Subject: [PATCH 4/7] README.md: Update to my current email
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
+---
+ README.md | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/README.md b/README.md
+index fedab04b7f00..22b36a4b7bed 100644
+--- a/README.md
++++ b/README.md
+@@ -50,7 +50,7 @@ $ mtrace ./ptest-runner $(MALLOC_TRACE)
+
+ For contribute please send a patch with subject prefix "[ptest-runner]" to
+ yocto@yoctoproject.org and cc the current maintainer that is Aníbal Limón
+-<anibal.limon@linux.intel.com>.
++<anibal.limon@linaro.org>.
+
+ ## Links
+
+--
+2.11.0
+
diff --git a/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0005-main.c-Use-realpath-to-get-the-actual-directory-of-p.patch b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0005-main.c-Use-realpath-to-get-the-actual-directory-of-p.patch
new file mode 100644
index 000000000..cb9e20a32
--- /dev/null
+++ b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0005-main.c-Use-realpath-to-get-the-actual-directory-of-p.patch
@@ -0,0 +1,42 @@
+From 5bd94a93c89978c5e729db86b86b49919cd3b523 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linaro.org>
+Date: Wed, 25 Apr 2018 12:05:29 -0500
+Subject: [PATCH 5/7] main.c: Use realpath to get the actual directory of
+ ptests
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fix usage of relative paths in -d argument.
+
+$ ./ptest-runner -d ./tests/data
+
+Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
+---
+ main.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/main.c b/main.c
+index 505829cdad58..593aff1a1956 100644
+--- a/main.c
++++ b/main.c
+@@ -19,6 +19,7 @@
+ * Aníbal Limón <anibal.limon@intel.com>
+ */
+
++#include <limits.h>
+ #include <unistd.h>
+ #include <string.h>
+ #include <stdlib.h>
+@@ -70,7 +71,7 @@ main(int argc, char *argv[])
+ switch (opt) {
+ case 'd':
+ free(opts.directory);
+- opts.directory = strdup(optarg);
++ opts.directory = realpath(optarg, NULL);
+ CHECK_ALLOCATION(opts.directory, 1, 1);
+ break;
+ case 'l':
+--
+2.11.0
+
diff --git a/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0006-main.c-Add-option-e-to-exclude-certain-tests-for-exe.patch b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0006-main.c-Add-option-e-to-exclude-certain-tests-for-exe.patch
new file mode 100644
index 000000000..7a4de868c
--- /dev/null
+++ b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0006-main.c-Add-option-e-to-exclude-certain-tests-for-exe.patch
@@ -0,0 +1,123 @@
+From 49956f65bb53ea2a2c1b394e5e59ffdfcdcc490f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linaro.org>
+Date: Wed, 25 Apr 2018 11:55:03 -0500
+Subject: [PATCH 6/7] main.c: Add option (-e) to exclude certain tests for
+ execution
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+You can specify a set of ptests to be excluded, it will not fail
+if some ptest excluded isn't found in the list of execution.
+
+$ ./ptest-runner -e "hang glibc" -d tests/data
+
+Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
+---
+ main.c | 38 +++++++++++++++++++++++++++++++++++---
+ utils.h | 1 +
+ 2 files changed, 36 insertions(+), 3 deletions(-)
+
+diff --git a/main.c b/main.c
+index 593aff1a1956..83600b7d1b31 100644
+--- a/main.c
++++ b/main.c
+@@ -19,6 +19,7 @@
+ * Aníbal Limón <anibal.limon@intel.com>
+ */
+
++#include <ctype.h>
+ #include <limits.h>
+ #include <unistd.h>
+ #include <string.h>
+@@ -42,8 +43,8 @@
+ static inline void
+ print_usage(FILE *stream, char *progname)
+ {
+- fprintf(stream, "Usage: %s [-d directory] [-l list] [-t timeout] [-x xml-filename]"
+- " [-h] [ptest1 ptest2 ...]\n", progname);
++ fprintf(stream, "Usage: %s [-d directory] [-e exclude] [-l list] [-t timeout]"
++ " [-x xml-filename] [-h] [ptest1 ptest2 ...]\n", progname);
+ }
+
+ int
+@@ -53,6 +54,8 @@ main(int argc, char *argv[])
+ int ptest_num = 0;
+ int i;
+ int rc;
++ int ptest_exclude_num = 0;
++ char *c, *tok;
+
+ #ifdef MEMCHECK
+ mtrace();
+@@ -62,18 +65,44 @@ main(int argc, char *argv[])
+ struct ptest_options opts;
+
+ opts.directory = strdup(DEFAULT_DIRECTORY);
++ opts.exclude = NULL;
+ opts.list = 0;
+ opts.timeout = DEFAULT_TIMEOUT;
+ opts.ptests = NULL;
+ opts.xml_filename = NULL;
+
+- while ((opt = getopt(argc, argv, "d:lt:x:h")) != -1) {
++ while ((opt = getopt(argc, argv, "d:e:lt:x:h")) != -1) {
+ switch (opt) {
+ case 'd':
+ free(opts.directory);
+ opts.directory = realpath(optarg, NULL);
+ CHECK_ALLOCATION(opts.directory, 1, 1);
+ break;
++ case 'e':
++ c = optarg;
++ ptest_exclude_num = 1;
++
++ while (*c) {
++ if (isspace(*c))
++ ptest_exclude_num++;
++ c++;
++ }
++
++
++ opts.exclude = malloc(ptest_exclude_num * sizeof(char));
++ CHECK_ALLOCATION(opts.exclude, 1, 1);
++
++ i = 0;
++ tok = strtok_r(optarg, " ", &c);
++ opts.exclude[i] = strdup(tok);
++ CHECK_ALLOCATION(opts.exclude[i], 1, 1);
++ i++;
++ while ((tok = strtok_r(NULL, " ", &c)) != NULL) {
++ opts.exclude[i] = strdup(tok);
++ CHECK_ALLOCATION(opts.exclude[i], 1, 1);
++ i++;
++ }
++ break;
+ case 'l':
+ opts.list = 1;
+ break;
+@@ -134,6 +163,9 @@ main(int argc, char *argv[])
+ ptest_list_free_all(head);
+ }
+
++ for (i = 0; i < ptest_exclude_num; i++)
++ ptest_list_remove(run, opts.exclude[i], 1);
++
+ rc = run_ptests(run, opts, argv[0], stdout, stderr);
+
+ ptest_list_free_all(run);
+diff --git a/utils.h b/utils.h
+index 8fa20a8bf621..ee85163ddfff 100644
+--- a/utils.h
++++ b/utils.h
+@@ -32,6 +32,7 @@
+
+ struct ptest_options {
+ char *directory;
++ char **exclude;
+ int list;
+ int timeout;
+ char **ptests;
+--
+2.11.0
+
diff --git a/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch
new file mode 100644
index 000000000..28c9c09bf
--- /dev/null
+++ b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch
@@ -0,0 +1,144 @@
+From 11b29ce444610a07067a89b38e9e85c2162bbf67 Mon Sep 17 00:00:00 2001
+From: Tim Orling <timothy.t.orling@linux.intel.com>
+Date: Mon, 15 Oct 2018 18:30:42 -0700
+Subject: [PATCH 7/7] [WIP] Initial LAVA support
+
+Linaro Automated Validation Architecture (LAVA) launches a test suite
+on the target but thereafter only observes stdout.
+
+LAVA knows that a test case has started or ended based on signals
+emitted to stdout:
+(setup)
+<LAVA_SIGNAL_STARTTC test_case_name>
+(teardown)
+<LAVA_SIGNAL_ENDTC test_case_name>
+<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=test_case_name RESULT=pass|fail \
+ [[ MEASUREMENT=numeric_measurement ][ UNITS=units_string]]>
+
+It is valid to have a measurement without units, but not units without a measurement.
+
+Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
+---
+ flags.h | 10 ++++++++++
+ main.c | 9 ++++++++-
+ utils.c | 15 +++++++++++++++
+ utils.h | 2 +-
+ 4 files changed, 34 insertions(+), 2 deletions(-)
+ create mode 100644 flags.h
+
+diff --git a/flags.h b/flags.h
+new file mode 100644
+index 000000000000..0dac2234e0b4
+--- /dev/null
++++ b/flags.h
+@@ -0,0 +1,10 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++
++/* Flag bit definitions */
++
++#ifndef __FLAGS_H__
++#define __FLAGS_H__
++
++#define LAVA_SIGNAL_ENABLE (0x0001)
++
++#endif /* __FLAGS_H__ */
+diff --git a/main.c b/main.c
+index 83600b7d1b31..92ced6926c3d 100644
+--- a/main.c
++++ b/main.c
+@@ -36,6 +36,7 @@
+ #endif
+
+ #include "utils.h"
++#include "flags.h"
+
+ #define DEFAULT_DIRECTORY "/usr/lib"
+ #define DEFAULT_TIMEOUT 300
+@@ -70,8 +71,9 @@ main(int argc, char *argv[])
+ opts.timeout = DEFAULT_TIMEOUT;
+ opts.ptests = NULL;
+ opts.xml_filename = NULL;
++ opts.flags = 0;
+
+- while ((opt = getopt(argc, argv, "d:e:lt:x:h")) != -1) {
++ while ((opt = getopt(argc, argv, "d:e:lt:x:Lh")) != -1) {
+ switch (opt) {
+ case 'd':
+ free(opts.directory);
+@@ -118,6 +120,11 @@ main(int argc, char *argv[])
+ opts.xml_filename = strdup(optarg);
+ CHECK_ALLOCATION(opts.xml_filename, 1, 1);
+ break;
++ case 'L':
++ // set LAVA signal mode
++ opts.flags |= LAVA_SIGNAL_ENABLE;
++ fprintf(stdout, "LAVA_SIGNAL_ENABLE == %d\n", opts.flags);
++ break;
+ default:
+ print_usage(stdout, argv[0]);
+ exit(1);
+diff --git a/utils.c b/utils.c
+index ed2eff7900c1..0fd1da6aec92 100644
+--- a/utils.c
++++ b/utils.c
+@@ -39,6 +39,7 @@
+
+ #include "ptest_list.h"
+ #include "utils.h"
++#include "flags.h"
+
+ #define GET_STIME_BUF_SIZE 1024
+ #define WAIT_CHILD_POLL_TIMEOUT_MS 200
+@@ -358,6 +359,7 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts,
+ fprintf(fp, "START: %s\n", progname);
+ PTEST_LIST_ITERATE_START(head, p);
+ char *ptest_dir = strdup(p->run_ptest);
++ char *ptest = strdup(p->ptest);
+ if (ptest_dir == NULL) {
+ rc = -1;
+ break;
+@@ -376,6 +378,11 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts,
+ int fds[2]; fds[0] = pipefd_stdout[0]; fds[1] = pipefd_stderr[0];
+ FILE *fps[2]; fps[0] = fp; fps[1] = fp_stderr;
+
++ char result[5]; // pass\0, fail\0, skip\0
++
++ if (opts.flags & LAVA_SIGNAL_ENABLE) {
++ fprintf(stdout, "<LAVA_SIGNAL_STARTTC %s>\n", ptest);
++ }
+ fprintf(fp, "%s\n", get_stime(stime, GET_STIME_BUF_SIZE));
+ fprintf(fp, "BEGIN: %s\n", ptest_dir);
+
+@@ -389,6 +396,14 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts,
+
+ fprintf(fp, "END: %s\n", ptest_dir);
+ fprintf(fp, "%s\n", get_stime(stime, GET_STIME_BUF_SIZE));
++ if (opts.flags & LAVA_SIGNAL_ENABLE) {
++ if (status)
++ sprintf(result, "fail");
++ else
++ sprintf(result, "pass");
++ fprintf(stdout, "<LAVA_SIGNAL_ENDTC %s>\n", ptest);
++ fprintf(stdout, "<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=%s>\n", ptest, result);
++ }
+ }
+ PTEST_LIST_ITERATE_END;
+ fprintf(fp, "STOP: %s\n", progname);
+diff --git a/utils.h b/utils.h
+index ee85163ddfff..06d4c100d151 100644
+--- a/utils.h
++++ b/utils.h
+@@ -37,9 +37,9 @@ struct ptest_options {
+ int timeout;
+ char **ptests;
+ char *xml_filename;
++ unsigned int flags;
+ };
+
+-
+ extern void check_allocation1(void *, size_t, char *, int, int);
+ extern struct ptest_list *get_available_ptests(const char *);
+ extern int print_ptests(struct ptest_list *, FILE *);
+--
+2.11.0
+
diff --git a/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.1.bbappend b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.1.bbappend
new file mode 100644
index 000000000..000ab3d53
--- /dev/null
+++ b/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.1.bbappend
@@ -0,0 +1,4 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0004-README.md-Update-to-my-current-email.patch file://0001-utils.c-Prefer-monotonic-clock-to-calculate-elapsed-.patch file://0002-Makefile-libcheck-now-requires-to-link-subunit.patch file://0003-Add-support-to-avoid-load-run-twice-a-run_ptest-scri.patch file://0005-main.c-Use-realpath-to-get-the-actual-directory-of-p.patch file://0006-main.c-Add-option-e-to-exclude-certain-tests-for-exe.patch file://0007-WIP-Initial-LAVA-support.patch"
+
1283' href='#n1283'>1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762