Skip to content

Commit ec96fcd

Browse files
authored
Merge pull request #7138 from ejohnstown/crl-mon-test-fix
CRL Monitor Test Fix
2 parents 4f8fd98 + b66a108 commit ec96fcd

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

tests/utils.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ int copy_file(const char* in, const char* out)
111111
XFCLOSE(outFile);
112112
return ret;
113113
}
114+
115+
#if defined(__MACH__) || defined(__FreeBSD__)
116+
int link_file(const char* in, const char* out)
117+
{
118+
return link(in, out);
119+
}
120+
#endif
114121
#endif /* !NO_FILESYSTEM */
115122

116123
#if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) && !defined(NO_RSA) && \

testsuite/testsuite.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ static int test_crl_monitor(void)
327327
if (i % 2 == 0) {
328328
/* succeed on even rounds */
329329
sprintf(buf, "%s/%s", tmpDir, "crl.pem");
330-
if (copy_file("certs/crl/crl.pem", buf) != 0) {
330+
if (STAGE_FILE("certs/crl/crl.pem", buf) != 0) {
331331
fprintf(stderr, "[%d] Failed to copy file to %s\n", i, buf);
332332
goto cleanup;
333333
}
@@ -350,7 +350,7 @@ static int test_crl_monitor(void)
350350
else {
351351
/* fail on odd rounds */
352352
sprintf(buf, "%s/%s", tmpDir, "crl.revoked");
353-
if (copy_file("certs/crl/crl.revoked", buf) != 0) {
353+
if (STAGE_FILE("certs/crl/crl.revoked", buf) != 0) {
354354
fprintf(stderr, "[%d] Failed to copy file to %s\n", i, buf);
355355
goto cleanup;
356356
}

wolfssl/test.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,13 @@ int rem_dir(const char* dirName);
656656
int rem_file(const char* fileName);
657657
int copy_file(const char* in, const char* out);
658658

659+
#if defined(__MACH__) || defined(__FreeBSD__)
660+
int link_file(const char* in, const char* out);
661+
#define STAGE_FILE(x,y) link_file((x),(y))
662+
#else
663+
#define STAGE_FILE(x,y) copy_file((x),(y))
664+
#endif
665+
659666
void signal_ready(tcp_ready* ready);
660667

661668
/* wolfSSL */

0 commit comments

Comments
 (0)