diff --git a/tests/data/test1517 b/tests/data/test1517
index c9b5e2e8c4..5f05379595 100644
--- a/tests/data/test1517
+++ b/tests/data/test1517
@@ -46,7 +46,7 @@ lib%TESTNUMBER
# precheck is a command line to run before the test, to see if we can execute
# the test or not
-./libtest/lib%TESTNUMBER check
+%LIBTESTS lib%TESTNUMBER check
diff --git a/tests/data/test1960 b/tests/data/test1960
index 1ab180c525..cf36b17592 100644
--- a/tests/data/test1960
+++ b/tests/data/test1960
@@ -22,7 +22,7 @@ Content-Length: 0
# Client-side
-./libtest/lib%TESTNUMBER check
+%LIBTESTS lib%TESTNUMBER check
http
diff --git a/tests/data/test518 b/tests/data/test518
index acc4319dd3..2fa7bfb5ca 100644
--- a/tests/data/test518
+++ b/tests/data/test518
@@ -40,7 +40,7 @@ lib%TESTNUMBER
# precheck is a command line to run before the test, to see if we can execute
# the test or not
-./libtest/lib%TESTNUMBER check
+%LIBTESTS lib%TESTNUMBER check
diff --git a/tests/data/test537 b/tests/data/test537
index 7ef864443f..c227a72cb1 100644
--- a/tests/data/test537
+++ b/tests/data/test537
@@ -40,7 +40,7 @@ lib%TESTNUMBER
# precheck is a command line to run before the test, to see if we can execute
# the test or not
-./libtest/lib%TESTNUMBER check
+%LIBTESTS lib%TESTNUMBER check
diff --git a/tests/data/test678 b/tests/data/test678
index bcf68e4f11..ea91ae6aec 100644
--- a/tests/data/test678
+++ b/tests/data/test678
@@ -41,7 +41,7 @@ https://localhost:%HTTPSPORT/%TESTNUMBER %CERTDIR/certs/test-ca.crt
# Ensure that we're running on localhost because we're checking the host name
-./libtest/lib%TESTNUMBER check
+%LIBTESTS lib%TESTNUMBER check
diff --git a/tests/servers.pm b/tests/servers.pm
index df32ca7e4e..02415c6ff5 100644
--- a/tests/servers.pm
+++ b/tests/servers.pm
@@ -3184,6 +3184,8 @@ sub subvariables {
$$thing =~ s/${prefix}CERTDIR/./g;
$$thing =~ s/${prefix}USER/$USER/g;
$$thing =~ s/${prefix}DEV_NULL/$dev_null/g;
+ my $libtests = $LIBDIR . 'libtests' . exe_ext('TOOL');
+ $$thing =~ s/${prefix}LIBTESTS/$libtests/g;
$$thing =~ s/${prefix}SSHSRVMD5/$SSHSRVMD5/g;
$$thing =~ s/${prefix}SSHSRVSHA256/$SSHSRVSHA256/g;