76Ensure (authutils, digest_hex_returns_correct_hex_string)
78 guchar digest[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
79 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};
81 assert_that (hex, is_not_null);
82 assert_that (hex, is_equal_to_string (
"000102030405060708090a0b0c0d0e0f"));
115Ensure (authutils, get_password_hashes_returns_valid_hash_pair)
118 assert_that (hashes, is_not_null);
121 gchar **split = g_strsplit (hashes,
" ", 2);
122 assert_that (split, is_not_null);
123 assert_that (split[0], is_not_null);
124 assert_that (split[1], is_not_null);
125 assert_that (split[2], is_null);
128 assert_that (strlen (split[0]), is_equal_to (32));
129 assert_that (strlen (split[1]), is_equal_to (32));
207 suite = create_test_suite ();
209 add_test_with_context (suite, authutils,
210 auth_method_name_returns_correct_strings);
211 add_test_with_context (suite, authutils,
212 auth_method_name_valid_returns_one_for_valid_names);
213 add_test_with_context (suite, authutils,
214 auth_method_name_valid_returns_zero_for_invalid_names);
215 add_test_with_context (suite, authutils,
216 gvm_auth_ldap_enabled_returns_one_when_enabled);
217 add_test_with_context (suite, authutils,
218 gvm_auth_radius_enabled_returns_one_when_enabled);
219 add_test_with_context (suite, authutils,
220 digest_hex_returns_correct_hex_string);
221 add_test_with_context (suite, authutils,
222 digest_hex_returns_null_for_invalid_algorithm);
223 add_test_with_context (suite, authutils,
224 get_md5_hash_from_string_returns_correct_hash);
225 add_test_with_context (suite, authutils,
226 get_md5_hash_from_string_handles_empty_string);
227 add_test_with_context (suite, authutils,
228 get_password_hashes_returns_valid_hash_pair);
229 add_test_with_context (
230 suite, authutils, gvm_authenticate_classic_succeeds_with_correct_password);
231 add_test_with_context (
232 suite, authutils, gvm_authenticate_classic_fails_with_incorrect_password);
233 add_test_with_context (suite, authutils,
234 gvm_authenticate_classic_fails_with_null_hash);
235 add_test_with_context (
237 gvm_authenticate_classic_returns_error_for_invalid_hash_format);
238 add_test_with_context (suite, authutils,
239 gvm_auth_init_succeeds_on_first_call);
240 add_test_with_context (suite, authutils, gvm_auth_init_fails_on_second_call);
243 ret = run_single_test (suite, argv[1], create_text_reporter ());
245 ret = run_test_suite (suite, create_text_reporter ());
247 destroy_test_suite (suite);