Commit ad1d71aa authored by Jakub Jelen's avatar Jakub Jelen Committed by Daiki Ueno

Test that ssh-agent started and sets environment

parent fdcd5663
......@@ -245,6 +245,27 @@ test_daemon_replace (Test *test,
g_assert_cmpint (status, ==, 0);
static void
test_ssh_agent (Test *test,
gconstpointer unused)
gchar *auth_sock = g_build_filename (test->directory, "keyring", "ssh", NULL);
const gchar *argv[] = {
BUILDDIR "/gnome-keyring-daemon", "--foreground",
"--components=ssh-agent", NULL
gchar **output;
output = gkd_test_launch_daemon (test->directory, argv, &test->pid, NULL);
g_assert_cmpstr (g_environ_getenv (output, "SSH_AUTH_SOCK"), ==, auth_sock);
g_strfreev (output);
g_assert (g_file_test (auth_sock, G_FILE_TEST_EXISTS));
g_free (auth_sock);
main (int argc, char **argv)
......@@ -263,6 +284,8 @@ main (int argc, char **argv)
g_test_add ("/daemon/startup/replace", Test, NULL,
setup, test_daemon_replace, teardown);
g_test_add ("/daemon/startup/ssh-agent", Test, NULL,
setup, test_ssh_agent, teardown);
return g_test_run ();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment