libssh/0001-disable-timeout-test-on-slow-buildsystems.patch

54 lines
2.2 KiB
Diff
Raw Normal View History

Index: libssh-0.9.0/tests/unittests/torture_misc.c
===================================================================
--- libssh-0.9.0.orig/tests/unittests/torture_misc.c 2019-06-28 08:45:32.418434037 +0200
+++ libssh-0.9.0/tests/unittests/torture_misc.c 2019-06-28 08:45:38.766497056 +0200
@@ -197,11 +197,13 @@ static void torture_timeout_elapsed(void
(void) state;
ssh_timestamp_init(&ts);
usleep(50000);
+#ifndef SLOW_TEST_SYSTEM
assert_true(ssh_timeout_elapsed(&ts,25));
assert_false(ssh_timeout_elapsed(&ts,30000));
assert_false(ssh_timeout_elapsed(&ts,75));
assert_true(ssh_timeout_elapsed(&ts,0));
assert_false(ssh_timeout_elapsed(&ts,-1));
+#endif /* SLOW_TEST_SYSTEM */
}
static void torture_timeout_update(void **state){
@@ -209,11 +211,13 @@ static void torture_timeout_update(void
(void) state;
ssh_timestamp_init(&ts);
usleep(50000);
+#ifndef SLOW_TEST_SYSTEM
assert_int_equal(ssh_timeout_update(&ts,25), 0);
assert_in_range(ssh_timeout_update(&ts,30000),29000,29960);
assert_in_range(ssh_timeout_update(&ts,75),1,40);
assert_int_equal(ssh_timeout_update(&ts,0),0);
assert_int_equal(ssh_timeout_update(&ts,-1),-1);
+#endif /* SLOW_TEST_SYSTEM */
}
static void torture_ssh_analyze_banner(void **state) {
Index: libssh-0.9.0/DefineOptions.cmake
===================================================================
--- libssh-0.9.0.orig/DefineOptions.cmake 2019-06-28 08:45:32.418434037 +0200
+++ libssh-0.9.0/DefineOptions.cmake 2019-06-28 08:46:08.330789588 +0200
@@ -22,6 +22,7 @@ option(WITH_ABI_BREAK "Allow ABI break"
option(WITH_GEX "Enable DH Group exchange mechanisms" ON)
option(FUZZ_TESTING "Build with fuzzer for the server" OFF)
option(PICKY_DEVELOPER "Build with picky developer flags" OFF)
+option(SLOW_TEST_SYSTEM "Disable tests that fail on slow systems" OFF)
if (WITH_ZLIB)
set(WITH_LIBZ ON)
@@ -57,3 +58,8 @@ endif (NOT GLOBAL_BIND_CONFIG)
if (NOT GLOBAL_CLIENT_CONFIG)
set(GLOBAL_CLIENT_CONFIG "/etc/ssh/ssh_config")
endif (NOT GLOBAL_CLIENT_CONFIG)
+
+if (SLOW_TEST_SYSTEM)
+ set (SLOW_TEST_SYSTEM ON)
+ add_definitions(-DSLOW_TEST_SYSTEM)
+endif (SLOW_TEST_SYSTEM)