mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
Fix possible timing issue with other tests copying the certs folder
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
#crl.test
|
||||
CERT_DIR=certs
|
||||
|
||||
# if we can, isolate the network namespace to eliminate port collisions.
|
||||
if [[ -n "$NETWORK_UNSHARE_HELPER" ]]; then
|
||||
if [[ -z "$NETWORK_UNSHARE_HELPER_CALLED" ]]; then
|
||||
@ -32,6 +30,9 @@ server_pid=$no_pid
|
||||
# also let's add some randomness by adding pid in case multiple 'make check's
|
||||
# per source tree
|
||||
ready_file=`pwd`/wolfssl_crl_ready$$
|
||||
CERT_DIR_ORIG=certs
|
||||
CERT_DIR=$(mktemp -d -p `pwd`)
|
||||
cp -rp $CERT_DIR_ORIG/* $CERT_DIR/.
|
||||
|
||||
remove_ready_file() {
|
||||
if test -e "$ready_file"; then
|
||||
@ -64,6 +65,7 @@ trap abort_trap INT TERM
|
||||
# instead use "exit <some value>" and this function will run automatically
|
||||
restore_file_system() {
|
||||
remove_ready_file
|
||||
rm -rf "$CERT_DIR"
|
||||
}
|
||||
trap restore_file_system EXIT
|
||||
|
||||
|
Reference in New Issue
Block a user