Crates.io | greetd-stub |
lib.rs | greetd-stub |
version | 0.3.0 |
source | src |
created_at | 2024-04-29 18:31:28.872942 |
updated_at | 2024-05-03 05:21:22.077603 |
description | Greetd server stub for development and testing |
homepage | https://github.com/apognu/greetd-stub |
repository | https://github.com/apognu/greetd-stub |
max_upload_size | |
id | 1224398 |
size | 79,715 |
This software can be used, either as a binary or a library, to spin up a more-or-less greetd-compatible server, to be used to develop against, or for automated testing.
It will ask for a user, password, and optionally a MFA-kind question and a fingerprint scan.
$ greetd-stub -s /tmp/greetd-stub.sock --user apognu:mypassword --mfa --fingerprint
You can then direct you greeter to the provided socket (which defaults to /tmp/greetd-stub.sock
) to make it work.
This software can also be used in-process in order to spin us a greetd server from within your test environment:
use libgreetd_stub::SessionOptions;
#[tokio::main]
async fn mytest() {
let opts = SessionOptions {
username: "apognu",
password: "mypassword",
mfa: false,
fingerprint: false,
};
let server = tokio::task::spawn(async move {
libgreetd_stub::start("/tmp/greetd-stub.sock", opts).await;
});
// Awaiting `server` will spin up the stub, you can now run your integration tests.
}