[Openvpn-devel] test_crypto: fix test_occ_mtu_calculation with --disable-fragment

Message ID 20220624122657.28675-1-frank@lichtenheld.com
State New
Headers show
Series
  • [Openvpn-devel] test_crypto: fix test_occ_mtu_calculation with --disable-fragment
Related show

Commit Message

Frank Lichtenheld June 24, 2022, 12:26 p.m.
Doesn't make sense to test with fragment, if the code
ignores it.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
---
 tests/unit_tests/openvpn/test_crypto.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/tests/unit_tests/openvpn/test_crypto.c b/tests/unit_tests/openvpn/test_crypto.c
index 83572b82..aec4e049 100644
--- a/tests/unit_tests/openvpn/test_crypto.c
+++ b/tests/unit_tests/openvpn/test_crypto.c
@@ -299,13 +299,15 @@  test_occ_mtu_calculation(void **state)
     linkmtu = calc_options_string_link_mtu(&o, &f);
     assert_int_equal(linkmtu, 1445);
 
+#if defined(ENABLE_FRAGMENT)
     /* secret, comp-lzo yes, cipher BF-CBC, auth SHA1, fragment 1200 */
     o.ce.fragment = 1200;
     linkmtu = calc_options_string_link_mtu(&o, &f);
     assert_int_equal(linkmtu, 1449);
+    o.ce.fragment = 0;
+#endif
 
     o.comp.alg = COMP_ALG_UNDEF;
-    o.ce.fragment = 0;
 #endif
 
     /* TLS mode */
@@ -350,7 +352,7 @@  test_occ_mtu_calculation(void **state)
     assert_int_equal(linkmtu, 1449);
 
 
-#if defined(USE_COMP)
+#if defined(USE_COMP) && defined(ENABLE_FRAGMENT)
     o.comp.alg = COMP_ALG_LZO;
 
     /* tls client, auth SHA1, cipher AES-256-GCM, fragment, comp-lzo yes */