Skip to content

Commit

Permalink
running CI
Browse files Browse the repository at this point in the history
  • Loading branch information
djach7 committed May 15, 2023
1 parent d909d9d commit 8cdbcbe
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ paste = "1.0"
passwd = "0.0.1"
pem = "2.0"
users = "0.11.0"
sha-crypt = "0.5.0"

fdo-data-formats = { path = "../data-formats" }
fdo-util = { path = "../util" }
2 changes: 2 additions & 0 deletions integration-tests/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -808,13 +808,15 @@ impl<'a> TestServerConfigurator<'a> {
users::get_current_username().unwrap().to_str().unwrap(),
);
cfg.insert("sshkey", "sshkey_default");
cfg.insert("password", "testpassword");
} else {
L.l("per_device_serviceinfo is set, using device specific values");
cfg.insert(
"user",
users::get_current_username().unwrap().to_str().unwrap(),
);
cfg.insert("sshkey", "sshkey_per_device");
cfg.insert("password", "testpassword");
}

// TODO: Insert more defaults
Expand Down
4 changes: 3 additions & 1 deletion integration-tests/tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ where
env::set_var("PER_DEVICE_SERVICEINFO", "false");
let mut ctx = TestContext::new().context("Error building test context")?;
let new_user: &str = "testuser"; // new user to be created during onboarding
let new_pw: &str = "testpassword"; // new password to accompany new user during onboarding
let encrypted_disk_loc = ctx.testpath().join("encrypted.img");
let rendezvous_server = ctx
.start_test_server(
Expand All @@ -156,7 +157,8 @@ where
&encrypted_disk_loc.to_string_lossy(),
);
if ci {
cfg.insert("user", new_user)
cfg.insert("user", new_user);
cfg.insert("password", new_pw);
};
Ok(())
})?)
Expand Down
12 changes: 9 additions & 3 deletions integration-tests/tests/service_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use common::{Binary, LogSide, TestContext};

use anyhow::{bail, Context, Result};

use sha_crypt::{sha256_check};

const L: LogSide = LogSide::Test;

#[tokio::test]
Expand Down Expand Up @@ -125,7 +127,7 @@ where
env::set_var("PER_DEVICE_SERVICEINFO", "false");
let mut ctx = TestContext::new().context("Error building test context")?;
let new_user: &str = "testuser"; // new user to be created during onboarding
let new_pw: &str = "testpassword"; // new password to accompany new user
let new_pw: &str = "testpassword"; // new password to accompany new user during onboarding
let encrypted_disk_loc = ctx.testpath().join("encrypted2.img");
let rendezvous_server = ctx
.start_test_server(
Expand All @@ -145,7 +147,7 @@ where
);
if ci {
cfg.insert("user", new_user);
cfg.insert("password", new_pw)
cfg.insert("password", new_pw);
};
Ok(())
})?)
Expand Down Expand Up @@ -396,9 +398,13 @@ sshkey_default
if let Some(test_user) = passwd::Passwd::from_name(new_user) {
pretty_assertions::assert_eq!(
test_user.password.is_empty(),
true,
false,
"Password not created during onboarding"
);
let pwtest = String::from(test_user.password);
L.l("password output {}", pwtest.as_str());
assert!(sha256_check("testpassword", &test_user.password).is_ok());

}
} else {
L.l("Skipped create initial user validation
Expand Down

0 comments on commit 8cdbcbe

Please sign in to comment.