summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2018-07-04 07:42:44 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2018-07-11 15:20:28 +0000
commitb9320a8b251129ee54cc943b748af3a85a53b229 (patch)
tree8224be45162d19619ffa38bced2c344b28df5545
parentbd87a9ffbf286f802c171f92b87b5f4edfcdfeb7 (diff)
downloadgnutls-b9320a8b251129ee54cc943b748af3a85a53b229.tar.gz
tests: handshake-timeout: use virt_sec_sleep() to avoid long delays in test
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/handshake-timeout.c (renamed from tests/mini-handshake-timeout.c)10
2 files changed, 7 insertions, 5 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5d6a306445..2ad3b527a4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -145,7 +145,7 @@ ctests += mini-record-2 simple gnutls_hmac_fast set_pkcs12_cred cert certuniquei
gnutls_x509_privkey_import gnutls_x509_crt_list_import \
sign-verify-ext4 tls-neg-ext4-key resume-lifetime \
mini-dtls-srtp rsa-encrypt-decrypt mini-loss-time gnutls-strcodes \
- mini-record mini-dtls-record mini-handshake-timeout mini-record-range \
+ mini-record mini-dtls-record handshake-timeout mini-record-range \
mini-cert-status fips-mode-pthread rsa-psk global-init sec-params sign-verify-data \
fips-test fips-override-test mini-global-load name-constraints x509-extensions \
long-session-id mini-x509-callbacks-intr mini-dtls-lowmtu set_x509_key_file-late \
diff --git a/tests/mini-handshake-timeout.c b/tests/handshake-timeout.c
index b4d1c2c962..c7ff20ca9e 100644
--- a/tests/mini-handshake-timeout.c
+++ b/tests/handshake-timeout.c
@@ -15,9 +15,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with GnuTLS; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#ifdef HAVE_CONFIG_H
@@ -46,6 +45,7 @@ int main()
#include <gnutls/gnutls.h>
#include <gnutls/dtls.h>
#include <signal.h>
+#include <virt-time.h>
#include "utils.h"
@@ -156,7 +156,7 @@ static void server(int fd, int wait)
gnutls_transport_set_int(session, fd);
if (wait) {
- sec_sleep(25);
+ virt_sec_sleep(25);
} else {
do {
ret = gnutls_handshake(session);
@@ -217,6 +217,8 @@ static void ch_handler(int sig)
void doit(void)
{
+ virt_time_init();
+
signal(SIGCHLD, ch_handler);
signal(SIGPIPE, SIG_IGN);