Don't assume source and binary directories are the same

Some of the scripts assumed that other scripts would be located in the
same directory where the current script was executed.

Also fixed the SSL connection creation which depended on an obsolete
environment variable causing all out-of-source SSL tests to fail.
This commit is contained in:
Markus Mäkelä
2018-05-11 00:10:24 +03:00
parent 16b777ad17
commit b776ed7821
17 changed files with 88 additions and 74 deletions

View File

@ -12,6 +12,7 @@
#include "mariadb_func.h"
#include "templates.h"
#include <ctype.h>
#include <sstream>
@ -20,20 +21,11 @@ int set_ssl(MYSQL* conn)
char client_key[1024];
char client_cert[1024];
char ca[1024];
char* test_dir = getenv("test_dir");
if (test_dir == NULL)
{
sprintf(client_key, "./ssl-cert/client-key.pem");
sprintf(client_cert, "./ssl-cert/client-cert.pem");
sprintf(ca, "./ssl-cert/ca.pem");
}
else
{
sprintf(client_key, "%s/ssl-cert/client-key.pem", test_dir);
sprintf(client_cert, "%s/ssl-cert/client-cert.pem", test_dir);
sprintf(ca, "%s/ssl-cert/ca.pem", test_dir);
}
sprintf(client_key, "%s/ssl-cert/client-key.pem", test_dir);
sprintf(client_cert, "%s/ssl-cert/client-cert.pem", test_dir);
sprintf(ca, "%s/ssl-cert/ca.pem", test_dir);
return mysql_ssl_set(conn, client_key, client_cert, ca, NULL, NULL);
}