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

Ryszard Knop ryszard.knop at intel.com
Wed Aug 31 11:07:27 UTC 2022


v2: Removed unnecessary checks, misc cleanup (Mauro)
Signed-off-by: Ryszard Knop <ryszard.knop at intel.com>
---
 runner/executor.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/runner/executor.c b/runner/executor.c
index 9b89cc09..964d0063 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -1860,10 +1860,10 @@ bool execute(struct execute_state *state,
 	     struct settings *settings,
 	     struct job_list *job_list)
 {
+	int resdirfd, testdirfd, unamefd, timefd, sigfd;
+	struct environment_variable *env_var;
 	struct utsname unamebuf;
-	int resdirfd, testdirfd, unamefd, timefd;
 	sigset_t sigmask;
-	int sigfd;
 	double time_spent = 0.0;
 	bool status = true;
 
@@ -1872,6 +1872,10 @@ bool execute(struct execute_state *state,
 		return true;
 	}
 
+	igt_list_for_each_entry(env_var, &settings->env_vars, link) {
+		setenv(env_var->key, env_var->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.37.2



More information about the igt-dev mailing list