Skip to content

sequoia-keystore tests fail when softkeys feature is not enabled

In Debian, we run tests for crates in the following ways:

  • all features (cargo test --all-features)
  • default features (cargo test)
  • no features (cargo test --no-default-features)
  • each discrete feature on its own (for each feature F, cargo test --no-default-features --features F)

The "no features" test and testing just the gpg-agent feature results in test failures for the keystore crate for the same reasons, so it appears that the tests require the softkeys feature.

Would it be possible to feature-guard the tests that require softkeys and/or adjust the tests to work without softkeys?

Thanks for all the work on sequoia!

Testing failures
running 10 tests
test tests::import_export ... FAILED
test tests::password_key_decrypt_pkesk2 ... FAILED
test tests::change_password ... FAILED
test tests::password_key_decrypt_pkesk ... FAILED
test tests::password_source ... FAILED
test tests::simple_key_decrypt_pkesk ... FAILED
test tests::simple_ping ... FAILED
test tests::simple_bash ... FAILED
test tests::simple_keystore_decrypt ... FAILED
test tests::simple_key_sign ... FAILED

failures:

---- tests::import_export stdout ----
Using ephemeral (/tmp/sequoia-N3cuV2)
thread 'tests::import_export' panicked at keystore/src/lib.rs:1958:37:
have softkeys backend

---- tests::password_key_decrypt_pkesk2 stdout ----
Using ephemeral (/tmp/sequoia-0AiSD4)
password/for-alice-bob.pgp
  0: Public-Key Encrypted Session Key Packet
  1: Public-Key Encrypted Session Key Packet
  2: Sym. Encrypted and Integrity Protected Data Packet
thread 'tests::password_key_decrypt_pkesk2' panicked at keystore/src/lib.rs:1902:21:
Failed to decrypt, but a password isn't required: EOF.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- tests::change_password stdout ----
Using ephemeral (/tmp/sequoia-HYTYpw)
Decrypting password/for-alice-bob.pgp
thread 'tests::change_password' panicked at keystore/src/lib.rs:1274:13:
assertion `left == right` failed
  left: []
 right: [Fingerprint("568078BB9A65285B8A7B4498E3B63B9AE4D10DD5"), Fingerprint("9B980721629F4A98332438635AE7278072A2D0D2")]

---- tests::password_key_decrypt_pkesk stdout ----
Using ephemeral (/tmp/sequoia-mBOj4Z)
Decrypting password/for-alice-bob.pgp
thread 'tests::password_key_decrypt_pkesk' panicked at keystore/src/lib.rs:1274:13:
assertion `left == right` failed
  left: []
 right: [Fingerprint("568078BB9A65285B8A7B4498E3B63B9AE4D10DD5"), Fingerprint("9B980721629F4A98332438635AE7278072A2D0D2")]

---- tests::password_source stdout ----
Using ephemeral (/tmp/sequoia-Fwa1FZ)
thread 'tests::password_source' panicked at keystore/src/lib.rs:2014:37:
have softkeys backend

---- tests::simple_key_decrypt_pkesk stdout ----
Using ephemeral (/tmp/sequoia-KQndYp)
thread 'tests::simple_key_decrypt_pkesk' panicked at keystore/src/lib.rs:1571:13:
Alice's primary key is not present on the key store.

---- tests::simple_ping stdout ----
Using ephemeral (/tmp/sequoia-oKYfdi)
Got 0 backends
Listing devices
thread 'tests::simple_ping' panicked at keystore/src/lib.rs:1330:9:
assertion failed: saw_softkeys

---- tests::simple_bash stdout ----
Using ephemeral (/tmp/sequoia-ly2wJ5)
thread '<unnamed>' panicked at keystore/src/lib.rs:1400:21:
assertion failed: saw_softkeys
thread '<unnamed>' panicked at keystore/src/lib.rs:1400:21:
assertion failed: saw_softkeys
thread '<unnamed>' panicked at keystore/src/lib.rs:1400:21:
assertion failed: saw_softkeys
thread 'tests::simple_bash' panicked at keystore/src/lib.rs:1408:22:
called `Result::unwrap()` on an `Err` value: Any { .. }

---- tests::simple_keystore_decrypt stdout ----
Using ephemeral (/tmp/sequoia-7muink)
Decrypting simple/for-alice.pgp
Failed to decrypt: EOF
Decrypting simple/for-bob.pgp
Failed to decrypt: EOF
Decrypting simple/for-carol.pgp
Failed to decrypt: EOF
Decrypting simple/for-dave.pgp
Decrypting simple/for-alice-bob.pgp
Failed to decrypt: EOF
Decrypting simple/for-alice-carol.pgp
Failed to decrypt: EOF
Decrypting simple/for-alice-dave.pgp
Failed to decrypt: EOF
Decrypting simple/for-bob-alice.pgp
Failed to decrypt: EOF
Decrypting simple/for-carol-alice.pgp
Failed to decrypt: EOF
Decrypting simple/for-carol-dave.pgp
Failed to decrypt: EOF
Decrypting simple/for-dave-alice.pgp
Failed to decrypt: EOF
Decrypting simple/for-dave-carol.pgp
Failed to decrypt: EOF
Decrypting simple/for-dave-alice-bob-carol.pgp
Failed to decrypt: EOF
thread 'tests::simple_keystore_decrypt' panicked at keystore/src/lib.rs:1537:13:
12 tests failed

---- tests::simple_key_sign stdout ----
Using ephemeral (/tmp/sequoia-PGHXme)
thread 'tests::simple_key_sign' panicked at keystore/src/lib.rs:1799:9:
assertion failed: saw_softkeys


failures:
    tests::change_password
    tests::import_export
    tests::password_key_decrypt_pkesk
    tests::password_key_decrypt_pkesk2
    tests::password_source
    tests::simple_bash
    tests::simple_key_decrypt_pkesk
    tests::simple_key_sign
    tests::simple_keystore_decrypt
    tests::simple_ping

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