Example #1
0
int
main (int argc, char **argv)
{
	SoupServer *server;
	GHashTable *connections;
	SoupURI *uri;

	test_init (argc, argv, NULL);

	server = soup_test_server_new (TRUE);
	connections = g_hash_table_new (NULL, NULL);
	soup_server_add_handler (server, NULL,
				 server_callback, connections, NULL);

	uri = soup_uri_new ("http://127.0.0.1/");
	soup_uri_set_port (uri, soup_server_get_port (server));

	/* Built-in NTLM auth support. (We set SOUP_NTLM_AUTH_DEBUG to
	 * an empty string to ensure that the built-in support is
	 * being used, even if /usr/bin/ntlm_auth is available.)
	 */
	g_setenv ("SOUP_NTLM_AUTH_DEBUG", "", TRUE);
	debug_printf (1, "Built-in NTLM support\n");
	do_ntlm_tests (uri, TRUE);

	/* Samba winbind /usr/bin/ntlm_auth helper support (via a
	 * helper program that emulate's its interface).
	 */
	g_setenv ("SOUP_NTLM_AUTH_DEBUG", BUILDDIR "/ntlm-test-helper", TRUE);
	debug_printf (1, "\nExternal helper support\n");
	do_ntlm_tests (uri, FALSE);

	/* Support for when ntlm_auth is installed, but the user has
	 * no cached credentials (and thus we have to fall back to
	 * libsoup's built-in NTLM support).
	 */
	g_setenv ("SOUP_NTLM_AUTH_DEBUG_NOCREDS", "1", TRUE);
	debug_printf (1, "\nExternal -> fallback support\n");
	do_ntlm_tests (uri, TRUE);

	soup_uri_free (uri);

	soup_test_server_quit_unref (server);
	test_cleanup ();
	g_hash_table_destroy (connections);

	return errors != 0;
}
Example #2
0
int
main (int argc, char **argv)
{
	GMainLoop *loop;
	SoupServer *server;
	GHashTable *connections;
	SoupURI *uri;

	test_init (argc, argv, NULL);

	server = soup_test_server_new (FALSE);
	connections = g_hash_table_new (NULL, NULL);
	soup_server_add_handler (server, NULL,
				 server_callback, connections, NULL);

	loop = g_main_loop_new (NULL, TRUE);

	uri = soup_uri_new ("http://127.0.0.1/");
	soup_uri_set_port (uri, soup_server_get_port (server));
	do_ntlm_tests (uri);
	soup_uri_free (uri);

	g_main_loop_unref (loop);

	soup_test_server_quit_unref (server);
	test_cleanup ();
	g_hash_table_destroy (connections);

	return errors != 0;
}