fdo-rs / fido-device-onboard-rs

An implementation of the FIDO Device Onboard (FDO) spec written in Rust.
BSD 3-Clause "New" or "Revised" License
59 stars 33 forks source link

Tests not working on non-devcontainer environments #630

Closed mmartinv closed 7 months ago

mmartinv commented 7 months ago

Running tests in a non-devcontainer env with an unprivileged user still fails:

cargo test
   Compiling fdo-data v0.5.0 (/home/mmartinv/devel/src/github.com/fdo-rs/fido-device-onboard-rs/libfdo-data)
    Finished test [unoptimized + debuginfo] target(s) in 1.06s
     Running unittests src/main.rs (target/debug/deps/fdo_admin_tool-ff08e158d3c9431c)

running 1 test
test aio::configure::test::serialize_and_deserialize ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s

     Running unittests src/main.rs (target/debug/deps/fdo_client_linuxapp-9efbac98d63cc103)

running 4 tests
test serviceinfo::test::test_binaryfileinprogress_destination_path ... ok
test serviceinfo::test::test_pw_encryption ... ok
useradd: Permission denied.
useradd: cannot lock /etc/passwd; try again later.
test serviceinfo::test::test_user_creation_no_pw ... FAILED
useradd: Permission denied.
useradd: cannot lock /etc/passwd; try again later.
test serviceinfo::test::test_user_creation_with_pw ... FAILED

failures:

---- serviceinfo::test::test_user_creation_no_pw stdout ----
thread 'serviceinfo::test::test_user_creation_no_pw' panicked at client-linuxapp/src/serviceinfo.rs:875:9:
assertion failed: create_user(test_user).is_ok()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- serviceinfo::test::test_user_creation_with_pw stdout ----
thread 'serviceinfo::test::test_user_creation_with_pw' panicked at client-linuxapp/src/serviceinfo.rs:890:9:
assertion failed: create_user_with_password(test_user, test_password).is_ok()

failures:
    serviceinfo::test::test_user_creation_no_pw
    serviceinfo::test::test_user_creation_with_pw

test result: FAILED. 2 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

error: test failed, to rerun pass `-p fdo-client-linuxapp --bin fdo-client-linuxapp`