summaryrefslogtreecommitdiffstats
path: root/src/tests/sysdb-tests.c
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-11-21 16:52:33 -0500
committerSimo Sorce <simo@redhat.com>2013-01-04 14:40:54 -0500
commit707d7b29652f12a683dfd18ea84173b4147cdb8b (patch)
tree023c9a6aec01070abf81a78432692c1e52e8920d /src/tests/sysdb-tests.c
parenta8fd47c45cf61af28b8bc82b4ac79b67cd26135a (diff)
downloadsssd-707d7b29652f12a683dfd18ea84173b4147cdb8b.tar.gz
sssd-707d7b29652f12a683dfd18ea84173b4147cdb8b.tar.xz
sssd-707d7b29652f12a683dfd18ea84173b4147cdb8b.zip
Use SSSD specific errors for offline auth
This prevents reportin false errors when internal functions return a generic EINVAL or EACCES that should just be treated as internal errors.
Diffstat (limited to 'src/tests/sysdb-tests.c')
-rw-r--r--src/tests/sysdb-tests.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
index 1db907b5..a7c9d837 100644
--- a/src/tests/sysdb-tests.c
+++ b/src/tests/sysdb-tests.c
@@ -1665,8 +1665,10 @@ START_TEST (test_sysdb_cached_authentication_missing_password)
username = talloc_asprintf(tmp_ctx, "testuser%d", _i);
fail_unless(username != NULL, "talloc_asprintf failed.");
- cached_authentication_without_expiration(username, "abc", ENOENT);
- cached_authentication_with_expiration(username, "abc", ENOENT);
+ cached_authentication_without_expiration(username, "abc",
+ ERR_NO_CACHED_CREDS);
+ cached_authentication_with_expiration(username, "abc",
+ ERR_NO_CACHED_CREDS);
talloc_free(tmp_ctx);
@@ -1684,8 +1686,10 @@ START_TEST (test_sysdb_cached_authentication_wrong_password)
username = talloc_asprintf(tmp_ctx, "testuser%d", _i);
fail_unless(username != NULL, "talloc_asprintf failed.");
- cached_authentication_without_expiration(username, "abc", EINVAL);
- cached_authentication_with_expiration(username, "abc", EINVAL);
+ cached_authentication_without_expiration(username, "abc",
+ ERR_AUTH_FAILED);
+ cached_authentication_with_expiration(username, "abc",
+ ERR_AUTH_FAILED);
talloc_free(tmp_ctx);