summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-02-09 16:35:02 +0100
committerJörg Frings-Fürst <debian@jff.email>2022-02-09 16:35:02 +0100
commit8e924e2c919e6fbeae0045b67ac54b9697306d7d (patch)
tree2ddb2a40fd70018ada5fbab576002199771f67c5 /tests
parentf2b3dda12a731c2e0971cb7889728edaf23f6cb0 (diff)
New upstream version 2.5.5upstream/2.5.5upstream
Diffstat (limited to 'tests')
-rwxr-xr-xtests/t_lpback.sh7
-rw-r--r--tests/unit_tests/openvpn/test_argv.c1
-rw-r--r--tests/unit_tests/openvpn/test_ncp.c10
3 files changed, 14 insertions, 4 deletions
diff --git a/tests/t_lpback.sh b/tests/t_lpback.sh
index 6206899..6795299 100755
--- a/tests/t_lpback.sh
+++ b/tests/t_lpback.sh
@@ -35,13 +35,18 @@ CIPHERS=$(${top_builddir}/src/openvpn/openvpn --show-ciphers | \
# GD, 2014-07-06 do not test RC5-* either (fails on NetBSD w/o libcrypto_rc5)
CIPHERS=$(echo "$CIPHERS" | egrep -v '^(DES-EDE3-CFB1|DES-CFB1|RC5-)' )
+e=0
+if [ -z "$CIPHERS" ] ; then
+ echo "'openvpn --show-ciphers' FAILED (empty list)"
+ e=1
+fi
+
# Also test cipher 'none'
CIPHERS=${CIPHERS}$(printf "\nnone")
"${top_builddir}/src/openvpn/openvpn" --genkey secret key.$$
set +e
-e=0
for cipher in ${CIPHERS}
do
printf "Testing cipher ${cipher}... "
diff --git a/tests/unit_tests/openvpn/test_argv.c b/tests/unit_tests/openvpn/test_argv.c
index 3dc470a..ea0d367 100644
--- a/tests/unit_tests/openvpn/test_argv.c
+++ b/tests/unit_tests/openvpn/test_argv.c
@@ -267,6 +267,7 @@ main(void)
cmocka_unit_test(argv_str__empty_argv__empty_output),
cmocka_unit_test(argv_str__multiple_argv__correct_output),
cmocka_unit_test(argv_insert_head__non_empty_argv__head_added),
+ cmocka_unit_test(argv_insert_head__empty_argv__head_only),
};
return cmocka_run_group_tests_name("argv", tests, NULL, NULL);
diff --git a/tests/unit_tests/openvpn/test_ncp.c b/tests/unit_tests/openvpn/test_ncp.c
index 494a028..bcafd23 100644
--- a/tests/unit_tests/openvpn/test_ncp.c
+++ b/tests/unit_tests/openvpn/test_ncp.c
@@ -49,6 +49,7 @@ test_check_ncp_ciphers_list(void **state)
{
struct gc_arena gc = gc_new();
bool have_chacha = cipher_kt_get("CHACHA20-POLY1305");
+ bool have_blowfish = cipher_kt_get("BF-CBC");
assert_string_equal(mutate_ncp_cipher_list("none", &gc), "none");
assert_string_equal(mutate_ncp_cipher_list("AES-256-GCM:none", &gc),
@@ -56,7 +57,7 @@ test_check_ncp_ciphers_list(void **state)
assert_string_equal(mutate_ncp_cipher_list(aes_ciphers, &gc), aes_ciphers);
- if (have_chacha)
+ if (have_chacha && have_blowfish)
{
assert_string_equal(mutate_ncp_cipher_list(bf_chacha, &gc), bf_chacha);
assert_string_equal(mutate_ncp_cipher_list("BF-CBC:CHACHA20-POLY1305", &gc),
@@ -89,8 +90,11 @@ test_check_ncp_ciphers_list(void **state)
assert_string_equal(mutate_ncp_cipher_list("id-aes128-GCM:id-aes256-GCM",
&gc), "AES-128-GCM:AES-256-GCM");
#else
- assert_string_equal(mutate_ncp_cipher_list("BLOWFISH-CBC",
- &gc), "BF-CBC");
+ if (have_blowfish)
+ {
+ assert_string_equal(mutate_ncp_cipher_list("BLOWFISH-CBC",
+ &gc), "BF-CBC");
+ }
#endif
gc_free(&gc);
}