[igt-dev] [PATCH i-g-t 6/7] runner: Set requested env vars during execution

Ryszard Knop ryszard.knop at intel.com
Tue Jun 28 09:44:34 UTC 2022


Signed-off-by: Ryszard Knop <ryszard.knop at intel.com>
---
 runner/executor.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/runner/executor.c b/runner/executor.c
index 9b89cc09..21c41715 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -1872,6 +1872,14 @@ bool execute(struct execute_state *state,
 		return true;
 	}
 
+	if (!igt_list_empty_or_null(&settings->env_vars)) {
+		struct environment_variable *iter;
+
+		igt_list_for_each_entry(iter, &settings->env_vars, link) {
+			setenv(iter->key, iter->value, 1);
+		}
+	}
+
 	if ((resdirfd = open(settings->results_path, O_DIRECTORY | O_RDONLY)) < 0) {
 		/* Initialize state should have done this */
 		errf("Error: Failure opening results path %s\n",
-- 
2.36.1



More information about the igt-dev mailing list