forked from wolfSSL/wolfssl
detect build cases where external script test case doesn't make sense
This commit is contained in:
@@ -148,6 +148,7 @@ static void Usage(void)
|
|||||||
#endif
|
#endif
|
||||||
printf("-f Fewer packets/group messages\n");
|
printf("-f Fewer packets/group messages\n");
|
||||||
printf("-x Disable client cert/key loading\n");
|
printf("-x Disable client cert/key loading\n");
|
||||||
|
printf("-X Driven by eXternal test case\n");
|
||||||
#ifdef SHOW_SIZES
|
#ifdef SHOW_SIZES
|
||||||
printf("-z Print structure sizes\n");
|
printf("-z Print structure sizes\n");
|
||||||
#endif
|
#endif
|
||||||
@@ -213,6 +214,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||||||
int resumeSession = 0;
|
int resumeSession = 0;
|
||||||
int wc_shutdown = 0;
|
int wc_shutdown = 0;
|
||||||
int disableCRL = 0;
|
int disableCRL = 0;
|
||||||
|
int externalTest = 0;
|
||||||
int ret;
|
int ret;
|
||||||
int scr = 0; /* allow secure renegotiation */
|
int scr = 0; /* allow secure renegotiation */
|
||||||
int forceScr = 0; /* force client initiaed scr */
|
int forceScr = 0; /* force client initiaed scr */
|
||||||
@@ -271,7 +273,8 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||||||
StackTrap();
|
StackTrap();
|
||||||
|
|
||||||
while ((ch = mygetopt(argc, argv,
|
while ((ch = mygetopt(argc, argv,
|
||||||
"?gdDusmNrwRitfxUPCh:p:v:l:A:c:k:b:zS:L:ToO:a")) != -1) {
|
"?gdDusmNrwRitfxXUPCh:p:v:l:A:c:k:b:zS:L:ToO:a"))
|
||||||
|
!= -1) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case '?' :
|
case '?' :
|
||||||
Usage();
|
Usage();
|
||||||
@@ -315,6 +318,10 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||||||
useClientCert = 0;
|
useClientCert = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'X' :
|
||||||
|
externalTest = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'f' :
|
case 'f' :
|
||||||
fewerPackets = 1;
|
fewerPackets = 1;
|
||||||
break;
|
break;
|
||||||
@@ -457,6 +464,27 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||||||
|
|
||||||
myoptind = 0; /* reset for test cases */
|
myoptind = 0; /* reset for test cases */
|
||||||
|
|
||||||
|
if (externalTest) {
|
||||||
|
/* detect build cases that wouldn't allow test against wolfssl.com */
|
||||||
|
int done = 0;
|
||||||
|
(void)done;
|
||||||
|
|
||||||
|
#ifdef NO_RSA
|
||||||
|
done = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NO_PSK
|
||||||
|
done = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (done) {
|
||||||
|
printf("external test can't be run in this mode");
|
||||||
|
|
||||||
|
((func_args*)args)->return_code = 0;
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* sort out DTLS versus TLS versions */
|
/* sort out DTLS versus TLS versions */
|
||||||
if (version == CLIENT_INVALID_VERSION) {
|
if (version == CLIENT_INVALID_VERSION) {
|
||||||
if (doDTLS)
|
if (doDTLS)
|
||||||
|
@@ -13,7 +13,7 @@ RESULT=$?
|
|||||||
[ $RESULT -ne 0 ] && echo -e "\n\nCouldn't find $server, skipping" && exit 0
|
[ $RESULT -ne 0 ] && echo -e "\n\nCouldn't find $server, skipping" && exit 0
|
||||||
|
|
||||||
# client test against the server
|
# client test against the server
|
||||||
./examples/client/client -C -h $server -p 443 -g -A $ca
|
./examples/client/client -X -C -h $server -p 443 -g -A $ca
|
||||||
RESULT=$?
|
RESULT=$?
|
||||||
[ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
|
[ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user