Skip to content

Commit

Permalink
[tests] fix crypto test to deal with new nss dlopen space
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Sep 14, 2017
1 parent 53783a8 commit 1029a24
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 33 deletions.
4 changes: 0 additions & 4 deletions libknet/tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ int_crypto_test_SOURCES = int_crypto.c \

int_crypto_test_CFLAGS = $(nss_CFLAGS)

int_crypto_test_LDFLAGS = $(nss_LIBS)

int_timediff_test_SOURCES = int_timediff.c

crypto_bench_test_SOURCES = crypto_bench.c \
Expand All @@ -81,8 +79,6 @@ crypto_bench_test_SOURCES = crypto_bench.c \

crypto_bench_test_CFLAGS = $(nss_CFLAGS)

crypto_bench_test_LDFLAGS = $(nss_LIBS)

knet_bench_test_SOURCES = knet_bench.c \
test-common.c \
../common.c \
Expand Down
14 changes: 2 additions & 12 deletions libknet/tests/crypto_bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static void test(void)
strncpy(knet_handle_crypto_cfg.crypto_hash_type, "sha1", sizeof(knet_handle_crypto_cfg.crypto_hash_type) - 1);
knet_handle_crypto_cfg.private_key_len = 2000;

if (knet_handle_crypto(knet_h, &knet_handle_crypto_cfg)) {
if (crypto_init(knet_h, &knet_handle_crypto_cfg) < 0) {
printf("knet_handle_crypto failed with correct config: %s\n", strerror(errno));
knet_handle_free(knet_h);
exit(FAIL);
Expand Down Expand Up @@ -234,17 +234,7 @@ static void test(void)

printf("Shutdown crypto\n");

memset(&knet_handle_crypto_cfg, 0, sizeof(struct knet_handle_crypto_cfg));
strncpy(knet_handle_crypto_cfg.crypto_model, "none", sizeof(knet_handle_crypto_cfg.crypto_model) - 1);
strncpy(knet_handle_crypto_cfg.crypto_cipher_type, "none", sizeof(knet_handle_crypto_cfg.crypto_cipher_type) - 1);
strncpy(knet_handle_crypto_cfg.crypto_hash_type, "none", sizeof(knet_handle_crypto_cfg.crypto_hash_type) - 1);
knet_handle_crypto_cfg.private_key_len = 2000;

if (knet_handle_crypto(knet_h, &knet_handle_crypto_cfg) < 0) {
printf("Unable to shutdown crypto: %s\n", strerror(errno));
knet_handle_free(knet_h);
exit(FAIL);
}
crypto_fini(knet_h);

knet_handle_free(knet_h);
free(buf1);
Expand Down
20 changes: 3 additions & 17 deletions libknet/tests/int_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ static void test(void)
strncpy(knet_handle_crypto_cfg.crypto_hash_type, "sha1", sizeof(knet_handle_crypto_cfg.crypto_hash_type) - 1);
knet_handle_crypto_cfg.private_key_len = 2000;

if (knet_handle_crypto(knet_h, &knet_handle_crypto_cfg)) {
printf("knet_handle_crypto failed with correct config: %s\n", strerror(errno));
if (crypto_init(knet_h, &knet_handle_crypto_cfg) < 0) {
printf("crypto_init failed: %s\n", strerror(errno));
knet_handle_free(knet_h);
flush_logs(logfds[0], stdout);
close_logpipes(logfds);
Expand Down Expand Up @@ -122,21 +122,7 @@ static void test(void)
}

printf("Shutdown crypto\n");

memset(&knet_handle_crypto_cfg, 0, sizeof(struct knet_handle_crypto_cfg));
strncpy(knet_handle_crypto_cfg.crypto_model, "none", sizeof(knet_handle_crypto_cfg.crypto_model) - 1);
strncpy(knet_handle_crypto_cfg.crypto_cipher_type, "none", sizeof(knet_handle_crypto_cfg.crypto_cipher_type) - 1);
strncpy(knet_handle_crypto_cfg.crypto_hash_type, "none", sizeof(knet_handle_crypto_cfg.crypto_hash_type) - 1);
knet_handle_crypto_cfg.private_key_len = 2000;

if (knet_handle_crypto(knet_h, &knet_handle_crypto_cfg) < 0) {
printf("Unable to shutdown crypto: %s\n", strerror(errno));
knet_handle_free(knet_h);
flush_logs(logfds[0], stdout);
close_logpipes(logfds);
exit(FAIL);
}

crypto_fini(knet_h);
flush_logs(logfds[0], stdout);

knet_handle_free(knet_h);
Expand Down

0 comments on commit 1029a24

Please sign in to comment.