mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-11-21 09:59:55 +00:00
Bridge zombienet tests: move all "framework" files under one folder (#3462)
Related to https://github.com/paritytech/polkadot-sdk/issues/3400 Moving all bridges testing "framework" files under one folder in order to be able to download the entire folder when we want to add tests in other repos No significant functional changes
This commit is contained in:
1 parent
3386377b0f
commit
6fc1d41d44
34 files changed
+45
-42
No files matched your search
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
|
||||
function start_background_process() {
|
||||
local command=$1
|
||||
local log_file=$2
|
||||
local __pid=$3
|
||||
|
||||
$command > $log_file 2>&1 &
|
||||
eval $__pid="'$!'"
|
||||
}
|
||||
|
||||
function wait_for_process_file() {
|
||||
local pid=$1
|
||||
local file=$2
|
||||
local timeout=$3
|
||||
local __found=$4
|
||||
|
||||
local time=0
|
||||
until [ -e $file ]; do
|
||||
if ! kill -0 $pid; then
|
||||
echo "Process finished unsuccessfully"
|
||||
return
|
||||
fi
|
||||
if (( time++ >= timeout )); then
|
||||
echo "Timeout waiting for file $file: $timeout seconds"
|
||||
eval $__found=0
|
||||
return
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "File $file found after $time seconds"
|
||||
eval $__found=1
|
||||
}
|
||||
|
||||
function ensure_process_file() {
|
||||
local pid=$1
|
||||
local file=$2
|
||||
local timeout=$3
|
||||
|
||||
wait_for_process_file $pid $file $timeout file_found
|
||||
if [ "$file_found" != "1" ]; then
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
Reference in new issue
Block a user