[#249] Add update tests result script

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2021-09-07 11:16:10 +03:00 committed by Alex Vanin
parent 26f30e7ace
commit 7ad81c4d09
2 changed files with 28 additions and 0 deletions

View file

@ -1,5 +1,10 @@
# S3 compatibility test results
To update this file using tests result run:
```sh
./updateTestsResult.sh ceph_tests_result.txt
```
## CopyObject
Compatibility: 14/17/17

23
updateTestsResult.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/bash
INPUT_FILE=$1
RESULT_FILE=docs/s3_test_results.md
while read -r line;
do
RES_LINE=$(echo "$line" | sed -nE '/^s3tests_boto3/p')
if [ -n "$RES_LINE" ]
then
TEST=$(echo "$RES_LINE" | sed -e 's/[[:space:]]*\.\.\..*//')
RESULT=$(echo "$RES_LINE" | sed -e 's/^.*\.\.\.[[:space:]]*//')
# beautify trailing spaces
OLD_RESULT=$(sed -n "s/^.*${TEST}[[:space:]]*|[[:space:]]\(.*\)[[:space:]]|.*|$/\1/p" "$RESULT_FILE")
OLD_RESULT_LEN=${#OLD_RESULT}
RESULT_LEN=${#RESULT}
ADDITIONAL_SPACES=$((OLD_RESULT_LEN - RESULT_LEN))
ADJUSTED_RESULT=$(printf "%s%*s" "$RESULT" $ADDITIONAL_SPACES '')
sed -i "/UNSUPPORTED/! s/^\(.*${TEST}[[:space:]]*\)|[[:space:]].*[[:space:]]|\(.*|\)$/\1| ${ADJUSTED_RESULT} |\2/" "$RESULT_FILE"
fi
done < "$INPUT_FILE"