Hi,
we had more custom SSSD error codes than error messages. Also order of messages was not correct in one case. The attached patch fixes this.
The second patch adds simple unit test to check if the number of error codes and error messages is the same.
See attached patch.
Thanks, Michal
On (10/03/15 20:23), Michal Židek wrote:
Hi,
we had more custom SSSD error codes than error messages. Also order of messages was not correct in one case. The attached patch fixes this.
The second patch adds simple unit test to check if the number of error codes and error messages is the same.
See attached patch.
Thanks, Michal
From bfffb612b1bba2824628ff59a799b14fad195a2a Mon Sep 17 00:00:00 2001 From: Michal Zidek mzidek@redhat.com Date: Tue, 10 Mar 2015 17:30:48 +0100 Subject: [PATCH 1/2] DEBUG: Add missing strings for error messages
We had more error codes than corresponding messages. Also order of two messages was wrong.
src/util/util_errors.c | 3 +++ src/util/util_errors.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/util/util_errors.c b/src/util/util_errors.c index 27d9ecc..5ce64a1 100644 --- a/src/util/util_errors.c +++ b/src/util/util_errors.c @@ -42,6 +42,9 @@ struct err_string error_to_str[] = { { "Network I/O Error" }, /* ERR_NETWORK_IO */ { "Account Expired" }, /* ERR_ACCOUNT_EXPIRED */ { "Password Expired" }, /* ERR_PASSWORD_EXPIRED */
- { "Password Expired (reject access)" }, /* ERR_PASSWORD_EXPIRED_REJECT */
- { "Password Expired (warn user)" }, /* ERR_PASSWORD_EXPIRED_WARN */
- { "Password Expired (ask for new password)" }, /* ERR_PASSWORD_EXPIRED_RENEW */ { "Host Access Denied" }, /* ERR_ACCESS_DENIED */ { "SRV record not found" }, /* ERR_SRV_NOT_FOUND */ { "SRV lookup error" }, /* ERR_SRV_LOOKUP_ERROR */
diff --git a/src/util/util_errors.h b/src/util/util_errors.h index de0ed35..36d0098 100644 --- a/src/util/util_errors.h +++ b/src/util/util_errors.h @@ -53,10 +53,10 @@ enum sssd_errors { ERR_INVALID_CRED_TYPE, ERR_NO_CREDS, ERR_CREDS_EXPIRED,
- ERR_CREDS_EXPIRED_CCACHE, ERR_CREDS_INVALID, ERR_NO_CACHED_CREDS, ERR_CACHED_CREDS_EXPIRED,
- ERR_CREDS_EXPIRED_CCACHE, ERR_AUTH_DENIED, ERR_AUTH_FAILED, ERR_CHPASS_DENIED,
-- 2.1.0
From 8144ea9404be5d87130450e5aa841f6840bc8fa1 Mon Sep 17 00:00:00 2001 From: Michal Zidek mzidek@redhat.com Date: Tue, 10 Mar 2015 18:38:10 +0100 Subject: [PATCH 2/2] test: Check ERR_LAST
Check if number of error codes and messages is the same.
src/tests/util-tests.c | 14 ++++++++++++++ src/util/util_errors.c | 1 + src/util/util_errors.h | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/tests/util-tests.c b/src/tests/util-tests.c index 3829b21..dc0690c 100644 --- a/src/tests/util-tests.c +++ b/src/tests/util-tests.c @@ -1070,6 +1070,16 @@ START_TEST(test_convert_time) } END_TEST
+START_TEST(test_sss_strerror_err_last) +{
- int ret;
- ret = strcmp("ERR_LAST", sss_strerror(ERR_LAST));
- fail_unless(ret == 0);
Could you use macro ck_assert_str_eq from check.h for string comparision? It would print verose assertion rather then "ret != 0"
LS
On 03/10/2015 08:56 PM, Lukas Slebodnik wrote:
On (10/03/15 20:23), Michal Židek wrote:
Hi,
we had more custom SSSD error codes than error messages. Also order of messages was not correct in one case. The attached patch fixes this.
The second patch adds simple unit test to check if the number of error codes and error messages is the same.
See attached patch.
Thanks, Michal
From bfffb612b1bba2824628ff59a799b14fad195a2a Mon Sep 17 00:00:00 2001 From: Michal Zidek mzidek@redhat.com Date: Tue, 10 Mar 2015 17:30:48 +0100 Subject: [PATCH 1/2] DEBUG: Add missing strings for error messages
We had more error codes than corresponding messages. Also order of two messages was wrong.
src/util/util_errors.c | 3 +++ src/util/util_errors.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/util/util_errors.c b/src/util/util_errors.c index 27d9ecc..5ce64a1 100644 --- a/src/util/util_errors.c +++ b/src/util/util_errors.c @@ -42,6 +42,9 @@ struct err_string error_to_str[] = { { "Network I/O Error" }, /* ERR_NETWORK_IO */ { "Account Expired" }, /* ERR_ACCOUNT_EXPIRED */ { "Password Expired" }, /* ERR_PASSWORD_EXPIRED */
- { "Password Expired (reject access)" }, /* ERR_PASSWORD_EXPIRED_REJECT */
- { "Password Expired (warn user)" }, /* ERR_PASSWORD_EXPIRED_WARN */
- { "Password Expired (ask for new password)" }, /* ERR_PASSWORD_EXPIRED_RENEW */ { "Host Access Denied" }, /* ERR_ACCESS_DENIED */ { "SRV record not found" }, /* ERR_SRV_NOT_FOUND */ { "SRV lookup error" }, /* ERR_SRV_LOOKUP_ERROR */
diff --git a/src/util/util_errors.h b/src/util/util_errors.h index de0ed35..36d0098 100644 --- a/src/util/util_errors.h +++ b/src/util/util_errors.h @@ -53,10 +53,10 @@ enum sssd_errors { ERR_INVALID_CRED_TYPE, ERR_NO_CREDS, ERR_CREDS_EXPIRED,
- ERR_CREDS_EXPIRED_CCACHE, ERR_CREDS_INVALID, ERR_NO_CACHED_CREDS, ERR_CACHED_CREDS_EXPIRED,
- ERR_CREDS_EXPIRED_CCACHE, ERR_AUTH_DENIED, ERR_AUTH_FAILED, ERR_CHPASS_DENIED,
-- 2.1.0
From 8144ea9404be5d87130450e5aa841f6840bc8fa1 Mon Sep 17 00:00:00 2001 From: Michal Zidek mzidek@redhat.com Date: Tue, 10 Mar 2015 18:38:10 +0100 Subject: [PATCH 2/2] test: Check ERR_LAST
Check if number of error codes and messages is the same.
src/tests/util-tests.c | 14 ++++++++++++++ src/util/util_errors.c | 1 + src/util/util_errors.h | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/tests/util-tests.c b/src/tests/util-tests.c index 3829b21..dc0690c 100644 --- a/src/tests/util-tests.c +++ b/src/tests/util-tests.c @@ -1070,6 +1070,16 @@ START_TEST(test_convert_time) } END_TEST
+START_TEST(test_sss_strerror_err_last) +{
- int ret;
- ret = strcmp("ERR_LAST", sss_strerror(ERR_LAST));
- fail_unless(ret == 0);
Could you use macro ck_assert_str_eq from check.h for string comparision? It would print verose assertion rather then "ret != 0"
LS
Goog idea. New patch attached.
Michal
On 03/12/2015 03:39 PM, Michal Židek wrote:
On 03/10/2015 08:56 PM, Lukas Slebodnik wrote:
On (10/03/15 20:23), Michal Židek wrote:
Hi,
we had more custom SSSD error codes than error messages. Also order of messages was not correct in one case. The attached patch fixes this.
The second patch adds simple unit test to check if the number of error codes and error messages is the same.
See attached patch.
Thanks, Michal
From bfffb612b1bba2824628ff59a799b14fad195a2a Mon Sep 17 00:00:00 2001 From: Michal Zidek mzidek@redhat.com Date: Tue, 10 Mar 2015 17:30:48 +0100 Subject: [PATCH 1/2] DEBUG: Add missing strings for error messages
We had more error codes than corresponding messages. Also order of two messages was wrong.
src/util/util_errors.c | 3 +++ src/util/util_errors.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/util/util_errors.c b/src/util/util_errors.c index 27d9ecc..5ce64a1 100644 --- a/src/util/util_errors.c +++ b/src/util/util_errors.c @@ -42,6 +42,9 @@ struct err_string error_to_str[] = { { "Network I/O Error" }, /* ERR_NETWORK_IO */ { "Account Expired" }, /* ERR_ACCOUNT_EXPIRED */ { "Password Expired" }, /* ERR_PASSWORD_EXPIRED */
- { "Password Expired (reject access)" }, /*
ERR_PASSWORD_EXPIRED_REJECT */
- { "Password Expired (warn user)" }, /* ERR_PASSWORD_EXPIRED_WARN */
- { "Password Expired (ask for new password)" }, /*
ERR_PASSWORD_EXPIRED_RENEW */ { "Host Access Denied" }, /* ERR_ACCESS_DENIED */ { "SRV record not found" }, /* ERR_SRV_NOT_FOUND */ { "SRV lookup error" }, /* ERR_SRV_LOOKUP_ERROR */ diff --git a/src/util/util_errors.h b/src/util/util_errors.h index de0ed35..36d0098 100644 --- a/src/util/util_errors.h +++ b/src/util/util_errors.h @@ -53,10 +53,10 @@ enum sssd_errors { ERR_INVALID_CRED_TYPE, ERR_NO_CREDS, ERR_CREDS_EXPIRED,
- ERR_CREDS_EXPIRED_CCACHE, ERR_CREDS_INVALID, ERR_NO_CACHED_CREDS, ERR_CACHED_CREDS_EXPIRED,
- ERR_CREDS_EXPIRED_CCACHE, ERR_AUTH_DENIED, ERR_AUTH_FAILED, ERR_CHPASS_DENIED,
-- 2.1.0
From 8144ea9404be5d87130450e5aa841f6840bc8fa1 Mon Sep 17 00:00:00 2001 From: Michal Zidek mzidek@redhat.com Date: Tue, 10 Mar 2015 18:38:10 +0100 Subject: [PATCH 2/2] test: Check ERR_LAST
Check if number of error codes and messages is the same.
src/tests/util-tests.c | 14 ++++++++++++++ src/util/util_errors.c | 1 + src/util/util_errors.h | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/tests/util-tests.c b/src/tests/util-tests.c index 3829b21..dc0690c 100644 --- a/src/tests/util-tests.c +++ b/src/tests/util-tests.c @@ -1070,6 +1070,16 @@ START_TEST(test_convert_time) } END_TEST
+START_TEST(test_sss_strerror_err_last) +{
- int ret;
- ret = strcmp("ERR_LAST", sss_strerror(ERR_LAST));
- fail_unless(ret == 0);
Could you use macro ck_assert_str_eq from check.h for string comparision? It would print verose assertion rather then "ret != 0"
LS
Goog idea. New patch attached.
Michal
This time with sssd-1-12 patches as well.
Michal
On (12/03/15 18:35), Michal Židek wrote:
On 03/12/2015 03:39 PM, Michal Židek wrote:
On 03/10/2015 08:56 PM, Lukas Slebodnik wrote:
On (10/03/15 20:23), Michal Židek wrote:
Hi,
we had more custom SSSD error codes than error messages. Also order of messages was not correct in one case. The attached patch fixes this.
The second patch adds simple unit test to check if the number of error codes and error messages is the same.
See attached patch.
Thanks, Michal
From bfffb612b1bba2824628ff59a799b14fad195a2a Mon Sep 17 00:00:00 2001 From: Michal Zidek mzidek@redhat.com Date: Tue, 10 Mar 2015 17:30:48 +0100 Subject: [PATCH 1/2] DEBUG: Add missing strings for error messages
We had more error codes than corresponding messages. Also order of two messages was wrong.
src/util/util_errors.c | 3 +++ src/util/util_errors.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/util/util_errors.c b/src/util/util_errors.c index 27d9ecc..5ce64a1 100644 --- a/src/util/util_errors.c +++ b/src/util/util_errors.c @@ -42,6 +42,9 @@ struct err_string error_to_str[] = { { "Network I/O Error" }, /* ERR_NETWORK_IO */ { "Account Expired" }, /* ERR_ACCOUNT_EXPIRED */ { "Password Expired" }, /* ERR_PASSWORD_EXPIRED */
- { "Password Expired (reject access)" }, /*
ERR_PASSWORD_EXPIRED_REJECT */
- { "Password Expired (warn user)" }, /* ERR_PASSWORD_EXPIRED_WARN */
- { "Password Expired (ask for new password)" }, /*
ERR_PASSWORD_EXPIRED_RENEW */ { "Host Access Denied" }, /* ERR_ACCESS_DENIED */ { "SRV record not found" }, /* ERR_SRV_NOT_FOUND */ { "SRV lookup error" }, /* ERR_SRV_LOOKUP_ERROR */ diff --git a/src/util/util_errors.h b/src/util/util_errors.h index de0ed35..36d0098 100644 --- a/src/util/util_errors.h +++ b/src/util/util_errors.h @@ -53,10 +53,10 @@ enum sssd_errors { ERR_INVALID_CRED_TYPE, ERR_NO_CREDS, ERR_CREDS_EXPIRED,
- ERR_CREDS_EXPIRED_CCACHE, ERR_CREDS_INVALID, ERR_NO_CACHED_CREDS, ERR_CACHED_CREDS_EXPIRED,
- ERR_CREDS_EXPIRED_CCACHE, ERR_AUTH_DENIED, ERR_AUTH_FAILED, ERR_CHPASS_DENIED,
-- 2.1.0
From 8144ea9404be5d87130450e5aa841f6840bc8fa1 Mon Sep 17 00:00:00 2001 From: Michal Zidek mzidek@redhat.com Date: Tue, 10 Mar 2015 18:38:10 +0100 Subject: [PATCH 2/2] test: Check ERR_LAST
Check if number of error codes and messages is the same.
src/tests/util-tests.c | 14 ++++++++++++++ src/util/util_errors.c | 1 + src/util/util_errors.h | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/tests/util-tests.c b/src/tests/util-tests.c index 3829b21..dc0690c 100644 --- a/src/tests/util-tests.c +++ b/src/tests/util-tests.c @@ -1070,6 +1070,16 @@ START_TEST(test_convert_time) } END_TEST
+START_TEST(test_sss_strerror_err_last) +{
- int ret;
- ret = strcmp("ERR_LAST", sss_strerror(ERR_LAST));
- fail_unless(ret == 0);
Could you use macro ck_assert_str_eq from check.h for string comparision? It would print verose assertion rather then "ret != 0"
LS
Goog idea. New patch attached.
Michal
This time with sssd-1-12 patches as well.
Michal
ACK for master http://sssd-ci.duckdns.org/logs/job/10/60/summary.html
ACK for sssd-1.12 http://sssd-ci.duckdns.org/logs/job/10/59/summary.html
Thank you very much for test.
LS
On Fri, Mar 13, 2015 at 09:28:09AM +0100, Lukas Slebodnik wrote:
ACK for master http://sssd-ci.duckdns.org/logs/job/10/60/summary.html
ACK for sssd-1.12 http://sssd-ci.duckdns.org/logs/job/10/59/summary.html
Thank you very much for test.
LS
* master: * 7650ded4ffa87fcf7ce5adf00920fecf89cffcf5 * 7c69221077c780e62f6c536e78675f2dc1c131bc * sssd-1-12: * c82b150d9599e212a71996d3f987f9b236833fe4 * b54376696a0f41b8187718c3589307dd1d9d1d4f
sssd-devel@lists.fedorahosted.org