]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/test/test-ask-password-api.c
Merge pull request #12223 from yuwata/network-wireguard-preshared-key-file
[thirdparty/systemd.git] / src / test / test-ask-password-api.c
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
8a1baa3a
ZJS
2
3#include "alloc-util.h"
4#include "ask-password-api.h"
5#include "log.h"
c7b7d74e 6#include "strv.h"
8a1baa3a
ZJS
7
8static void ask_password(void) {
9 int r;
c7b7d74e 10 _cleanup_strv_free_ char **ret = NULL;
8a1baa3a 11
daa55720 12 r = ask_password_tty(-1, "hello?", "da key", 0, 0, NULL, &ret);
8a1baa3a 13 assert(r >= 0);
c7b7d74e 14 assert(strv_length(ret) == 1);
8a1baa3a 15
c7b7d74e 16 log_info("Got %s", *ret);
8a1baa3a
ZJS
17}
18
19int main(int argc, char **argv) {
20 log_parse_environment();
21
22 ask_password();
23}