Skip to content

Commit

Permalink
fix: use system_info mod instead of relying on system commands
Browse files Browse the repository at this point in the history
use `system_info` mod functions to gather the current
user name instead of relying on system commands.

Signed-off-by: Miguel Martín <[email protected]>
  • Loading branch information
mmartinv committed Mar 1, 2024
1 parent e83b92b commit 4be99d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions integration-tests/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 4be99d6

Please sign in to comment.