summaryrefslogtreecommitdiff
path: root/src/login/test-login.c
diff options
context:
space:
mode:
authorMantas MikulÄ—nas <grawity@gmail.com>2013-12-22 02:48:46 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-21 22:02:57 -0500
commit5b04fe60004e7c5cd5a43648ede3e6a965e70b8c (patch)
tree8af2bf059a7aef482afbe3376f64ffc798e17114 /src/login/test-login.c
parentbee7e928990fd8a0c5909c2022a2b9eede557c81 (diff)
libsystemd-login: add sd_session_get_remote_{host, user}
Diffstat (limited to 'src/login/test-login.c')
-rw-r--r--src/login/test-login.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/login/test-login.c b/src/login/test-login.c
index 228ddb2933..ce88af80f0 100644
--- a/src/login/test-login.c
+++ b/src/login/test-login.c
@@ -30,7 +30,7 @@
static void test_login(void) {
int r, k;
uid_t u, u2;
- char *seat, *type, *class, *display;
+ char *seat, *type, *class, *display, *remote_user, *remote_host;
char *session;
char *state;
char *session2;
@@ -71,6 +71,10 @@ static void test_login(void) {
assert_se(r >= 0);
printf("active = %s\n", yes_no(r));
+ r = sd_session_is_remote(session);
+ assert_se(r >= 0);
+ printf("remote = %s\n", yes_no(r));
+
r = sd_session_get_state(session, &state);
assert_se(r >= 0);
printf("state = %s\n", state);
@@ -92,6 +96,14 @@ static void test_login(void) {
printf("display = %s\n", display);
free(display);
+ assert_se(sd_session_get_remote_user(session, &remote_user) >= 0);
+ printf("remote_user = %s\n", remote_user);
+ free(remote_user);
+
+ assert_se(sd_session_get_remote_host(session, &remote_host) >= 0);
+ printf("remote_host = %s\n", remote_host);
+ free(remote_host);
+
assert_se(sd_session_get_seat(session, &seat) >= 0);
printf("seat = %s\n", seat);