forked from projectcalico/calico
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-win-fv.sh
executable file
·52 lines (41 loc) · 1.25 KB
/
run-win-fv.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
set -e
set -x
FV_DIR="$HOME/$SEMAPHORE_GIT_DIR/process/testing/winfv-cni-plugin/aso"
pushd ${FV_DIR}
# Prepare local files
cp $HOME/$SEMAPHORE_GIT_DIR/cni-plugin/bin/windows/*.exe ./windows
# Run FV.
make run-fv | tee run-fv.log
# Get results and logs
ls -ltr ./report
mkdir /home/semaphore/fv.log
cp run-fv.log /home/semaphore/fv.log
cp ./report/*.log /home/semaphore/fv.log
# Stop for debug
echo "Check for pause file..."
while [ -f /home/semaphore/pause-for-debug ];
do
echo "#"
sleep 30
done
# Print relevant snippets from logs
log_regexps='(?<!Decode)Failure|SUCCESS|FV-TEST-START'
compgen -G /home/semaphore/fv.log/*.log > /dev/null && \
for log_file in /home/semaphore/fv.log/*.log; do
prefix="[$(basename ${log_file})]"
cat ${log_file} | iconv -f UTF-16 -t UTF-8 | sed 's/\r$//g' | grep --line-buffered --perl ${log_regexps} -B 2 -A 15 | sed 's/.*/'"${prefix}"' &/g'
done;
# Search for the file indicates that the Windows node has completed the FV process
if [ ! -f ./report/done-marker ];
then
echo "Windows node failed to complete the FV process."
exit 1
fi
# Search for error code file
if [ -f ./report/error-codes ];
then
echo "Windows FV returned error(s)."
exit 1
fi
echo "Run Windows FV is done."