From 4be99d6a5e95edd59dce100d1fad769dfd4c58de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Mart=C3=ADn?= Date: Wed, 28 Feb 2024 19:24:20 +0100 Subject: [PATCH] fix: use `system_info` mod instead of relying on system commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use `system_info` mod functions to gather the current user name instead of relying on system commands. Signed-off-by: Miguel Martín --- integration-tests/tests/common/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/integration-tests/tests/common/mod.rs b/integration-tests/tests/common/mod.rs index e406cc339..741816883 100644 --- a/integration-tests/tests/common/mod.rs +++ b/integration-tests/tests/common/mod.rs @@ -9,6 +9,8 @@ use std::{ time::{Duration, Instant}, }; +use fdo_util::system_info::get_current_user_name; + use anyhow::{bail, Context as _, Result}; use openssl::{ asn1::{Asn1Integer, Asn1Time}, @@ -808,9 +810,7 @@ impl<'a> TestServerConfigurator<'a> { &self.test_context.runner_path(&self.server_number), ); - let output = Command::new("whoami").output().unwrap(); - - let cur_user = String::from_utf8(output.stdout).unwrap(); + let cur_user = get_current_user_name(); if !per_device { L.l("per_device_serviceinfo is not set, using default values");