diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2016-03-15 16:14:23 +0100 |
---|---|---|
committer | Lukas Slebodnik <lslebodn@redhat.com> | 2016-04-07 09:21:27 +0200 |
commit | 1510d1264b44c437b8270e0a5a239e8624933c3d (patch) | |
tree | 7ea3752a9f211dd1720488f9e8d2fb3ba03820ba /src | |
parent | a9d1b4b61b614a954c784f224b8fe7a47b6dd206 (diff) | |
download | sssd-1510d1264b44c437b8270e0a5a239e8624933c3d.tar.gz sssd-1510d1264b44c437b8270e0a5a239e8624933c3d.tar.xz sssd-1510d1264b44c437b8270e0a5a239e8624933c3d.zip |
test_ipa_subdom_server: Workaround for slow krb5 + SELinux
There is an overhead caused by SELinux after fixing memory leak
in krb5. https://bugzilla.redhat.com/show_bug.cgi?id=1311287.
The overhead is mainly visible with valgrind and moreover
it causes failures due to timeouts.
sh$ time libtool --mode=execute ./test_ipa_subdom_server
enabled/permissive SELinux
real 0m7.976s
user 0m6.680s
sys 0m0.189s
disabled SELinux
real 0m2.111s
user 0m0.071s
sys 0m0.043s
valgrind + enabled/permissive SELinux
real 2m7.310s
user 2m17.080s
sys 0m0.786s
valgrind + disabled SELinux
real 0m5.510s
user 0m3.396s
sys 0m0.309s
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/cmocka/test_ipa_subdomains_server.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tests/cmocka/test_ipa_subdomains_server.c b/src/tests/cmocka/test_ipa_subdomains_server.c index 3c40f04e3..0fddc9518 100644 --- a/src/tests/cmocka/test_ipa_subdomains_server.c +++ b/src/tests/cmocka/test_ipa_subdomains_server.c @@ -69,6 +69,26 @@ static bool global_rename_called; +#ifdef HAVE_SELINUX +/* Provide faster implementation of kerberos function + * krb5int_labeled_[f]?open. Real functions take care also + * about SELinux context which is very expensive operation + * and cause failures due to timeout when executing with valgrind. + * It's approximately 40 times slower with real function + */ +FILE * +krb5int_labeled_fopen(const char *path, const char *mode) +{ + return fopen(path, mode); +} + +int +krb5int_labeled_open(const char *path, int flags, mode_t mode) +{ + return open(path, flags, mode); +} +#endif /* HAVE_SELINUX */ + krb5_error_code __wrap_krb5_kt_default(krb5_context context, krb5_keytab *id) { return krb5_kt_resolve(context, KEYTAB_PATH, id); |