Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<fix>(script,ci): relax check restriction of openssl version 3.x, version to 1.4.0, update ci to check in jdk 8.0.382. #600

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .ci/check_rare_string.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash



function LOG_ERROR()
{
local content=${1}
echo -e "\033[31m"${content}"\033[0m"
}

function LOG_INFO()
{
local content=${1}
echo -e "\033[32m"${content}"\033[0m"
}

get_md5sum_cmd() {
local md5sum_cmd="md5sum"
if [ "$(uname)" == "Darwin" ]; then
md5sum_cmd="md5"
fi
echo "$md5sum_cmd"
}

function checkConcatenatedRareString() {

concatenatedString=${1}
log_file=${2}
md5sum_cmd=$(get_md5sum_cmd)

md5_concatenatedString=$(echo -n "$concatenatedString" | $md5sum_cmd | awk '{print $1}')

# compare rare string and stringFromGet
get_output=$(cat ${log_file}| grep "result=" | awk -F '[][]' '{print $4}' | awk NF | tail -n 1)
md5_stringFromGet=$(echo -n "$get_output" | $md5sum_cmd | awk '{print $1}')
if [ "$md5_concatenatedString" != "$md5_stringFromGet" ]; then
LOG_ERROR "error: check failed, the md5 values of rareString and stringFromGet are not equal, fail concatenatedString: ${concatenatedString}, get_output: ${get_output}"
exit 1
else
LOG_INFO "check success, concatenatedString: ${concatenatedString}"
fi
}

main() {
concatenatedString=${1}
log_file=${2}
LOG_INFO "check rare string start, concatenatedString: ${concatenatedString}"

checkConcatenatedRareString ${concatenatedString} ${log_file}
LOG_INFO "check rare string finished!"
}

main "$@"

15 changes: 15 additions & 0 deletions .ci/ci_cross_all_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

set -e
ROOT=$(pwd)/demo/
CI_PWD=$(pwd)
PLUGIN_BRANCH=master
final_rare_input=""

LOG_INFO() {
local content=${1}
Expand All @@ -14,6 +16,14 @@ LOG_ERROR() {
echo -e "\033[31m[ERROR] ${content}\033[0m"
}

prepare_rare_string() {
final_rare_input=$(bash ${CI_PWD}/.ci/gen_rare_string.sh)
}

check_rare_string() {
bash ${CI_PWD}/.ci/check_rare_string.sh ${final_rare_input} ${ROOT}/WeCross-Console/logs/debug.log
}

check_log() {
cd ${ROOT}
error_log=routers-payment/127.0.0.1-8250-25500/logs/error.log
Expand Down Expand Up @@ -62,6 +72,8 @@ demo_test() {

ensure_bcos_nodes_running

prepare_rare_string

cd WeCross-Console/
bash start.sh <<EOF
listResources
Expand All @@ -83,13 +95,16 @@ call payment.bcos-gm.HelloWorld get
sendTransaction payment.bcos-gm.HelloWorld set Jerry
call payment.bcos-gm.HelloWorld get

sendTransaction payment.bcos-gm.HelloWorld set ${final_rare_input}
call payment.bcos-gm.HelloWorld get
quit
EOF
cd ..

check_log
check_console_log ${ROOT}/WeCross-Console/logs/warn.log
check_console_log ${ROOT}/WeCross-Console/logs/error.log
check_rare_string

}

Expand Down
15 changes: 15 additions & 0 deletions .ci/ci_cross_bcos3_demo_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

set -e
ROOT=$(pwd)/demo/
CI_PWD=$(pwd)
PLUGIN_BRANCH=master
final_rare_input=""

LOG_INFO() {
local content=${1}
Expand All @@ -14,6 +16,14 @@ LOG_ERROR() {
echo -e "\033[31m[ERROR] ${content}\033[0m"
}

prepare_rare_string() {
final_rare_input=$(bash ${CI_PWD}/.ci/gen_rare_string.sh)
}

check_rare_string() {
bash ${CI_PWD}/.ci/check_rare_string.sh ${final_rare_input} ${ROOT}/WeCross-Console/logs/debug.log
}

check_log() {
cd ${ROOT}
error_log=routers-payment/127.0.0.1-8250-25500/logs/error.log
Expand Down Expand Up @@ -56,6 +66,8 @@ cross_bcos3_demo_test() {

bash build_cross_bcos3.sh -H 127.0.0.1 -P 3306 -u root -p 123456

prepare_rare_string

cd WeCross-Console/
bash start.sh <<EOF
listResources
Expand All @@ -68,13 +80,16 @@ call payment.bcos3.HelloWorld get
call payment.bcos3_gm.HelloWorld get
sendTransaction payment.bcos3_gm.HelloWorld set Jerry
call payment.bcos3_gm.HelloWorld get
sendTransaction payment.bcos3_gm.HelloWorld set ${final_rare_input}
call payment.bcos3_gm.HelloWorld get
quit
EOF
cd ..

check_log
check_console_log ${ROOT}/WeCross-Console/logs/warn.log
check_console_log ${ROOT}/WeCross-Console/logs/error.log
check_rare_string
}

prepare_wecross() {
Expand Down
15 changes: 14 additions & 1 deletion .ci/ci_cross_fabric2_demo_check.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/bin/bash

set -e
CI_PWD=$(pwd)
ROOT=$(pwd)/demo/
PLUGIN_BRANCH=master
final_rare_input=""

LOG_INFO() {
local content=${1}
Expand All @@ -14,6 +16,14 @@ LOG_ERROR() {
echo -e "\033[31m[ERROR] ${content}\033[0m"
}

prepare_rare_string() {
final_rare_input=$(bash ${CI_PWD}/.ci/gen_rare_string.sh)
}

check_rare_string() {
bash ${CI_PWD}/.ci/check_rare_string.sh ${final_rare_input} ${ROOT}/WeCross-Console/logs/debug.log
}

check_log() {
cd ${ROOT}
error_log=routers-payment/127.0.0.1-8250-25500/logs/error.log
Expand Down Expand Up @@ -61,6 +71,7 @@ demo_test() {
bash build_cross_fabric2.sh -H 127.0.0.1 -P 3306 -u root -p 123456

ensure_bcos_nodes_running
prepare_rare_string

cd WeCross-Console/
bash start.sh <<EOF
Expand All @@ -73,14 +84,16 @@ sendTransaction payment.bcos.HelloWorld set Tom
call payment.bcos.HelloWorld get
sendTransaction payment.fabric2.sacc set a 666
call payment.fabric2.sacc query a
sendTransaction payment.fabric2.sacc set a ${final_rare_input}
call payment.fabric2.sacc query a
quit
EOF
cd ..

check_log
check_console_log ${ROOT}/WeCross-Console/logs/warn.log
check_console_log ${ROOT}/WeCross-Console/logs/error.log

check_rare_string
}

prepare_wecross() {
Expand Down
13 changes: 13 additions & 0 deletions .ci/ci_cross_gm_demo_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

set -e
ROOT=$(pwd)/demo/
CI_PWD=$(pwd)
PLUGIN_BRANCH=master
final_rare_input=""

LOG_INFO() {
local content=${1}
Expand All @@ -14,6 +16,13 @@ LOG_ERROR() {
echo -e "\033[31m[ERROR] ${content}\033[0m"
}

prepare_rare_string() {
final_rare_input=$(bash ${CI_PWD}/.ci/gen_rare_string.sh)
}

check_rare_string() {
bash ${CI_PWD}/.ci/check_rare_string.sh ${final_rare_input} ${ROOT}/WeCross-Console/logs/debug.log
}
check_log() {
cd ${ROOT}
error_log=routers-payment/127.0.0.1-8250-25500/logs/error.log
Expand Down Expand Up @@ -55,6 +64,7 @@ cross_normal_guomi_demo_test() {
cd ${ROOT}

bash build_cross_gm.sh -H 127.0.0.1 -P 3306 -u root -p 123456
prepare_rare_string

cd WeCross-Console/
bash start.sh <<EOF
Expand All @@ -68,13 +78,16 @@ call payment.bcos.HelloWorld get
call payment.bcos_gm.HelloWorld get
sendTransaction payment.bcos_gm.HelloWorld set Jerry
call payment.bcos_gm.HelloWorld get
sendTransaction payment.bcos_gm.HelloWorld set ${final_rare_input}
call payment.bcos_gm.HelloWorld get
quit
EOF
cd ..

check_log
check_console_log ${ROOT}/WeCross-Console/logs/warn.log
check_console_log ${ROOT}/WeCross-Console/logs/error.log
check_rare_string
}

prepare_wecross() {
Expand Down
12 changes: 12 additions & 0 deletions .ci/ci_demo_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

set -e
ROOT=$(pwd)/demo/
CI_PWD=$(pwd)
PLUGIN_BRANCH=master
final_rare_input=""

LOG_INFO() {
local content=${1}
Expand All @@ -13,7 +15,13 @@ LOG_ERROR() {
local content=${1}
echo -e "\033[31m[ERROR] ${content}\033[0m"
}
prepare_rare_string() {
final_rare_input=$(bash ${CI_PWD}/.ci/gen_rare_string.sh)
}

check_rare_string() {
bash ${CI_PWD}/.ci/check_rare_string.sh ${final_rare_input} ${ROOT}/WeCross-Console/logs/debug.log
}
check_log() {
cd ${ROOT}
error_log=routers-payment/127.0.0.1-8250-25500/logs/error.log
Expand Down Expand Up @@ -61,6 +69,7 @@ demo_test() {
bash -x build.sh -H 127.0.0.1 -P 3306 -u root -p 123456

ensure_bcos_nodes_running
prepare_rare_string

cd WeCross-Console/
bash start.sh <<EOF
Expand All @@ -74,13 +83,16 @@ call payment.bcos.HelloWorld get
call payment.fabric.sacc query a
sendTransaction payment.fabric.sacc set a 666
call payment.fabric.sacc query a
sendTransaction payment.fabric.sacc set a ${final_rare_input}
call payment.fabric.sacc query a
quit
EOF
cd ..

check_log
check_console_log ${ROOT}/WeCross-Console/logs/warn.log
check_console_log ${ROOT}/WeCross-Console/logs/error.log
check_rare_string

}

Expand Down
67 changes: 67 additions & 0 deletions .ci/gen_rare_string.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash
rare_str_range_names=("CJKUnifiedIdeographs" "CJKCompatibilityIdeographs" "CJKCompatibilityIdeographsSupplement" "KangxiRadicals" "CJKRadicalsSupplement" "IdeographicDescriptionCharacters" "Bopomofo" "BopomofoExtended" "CJKStrokes" "CJKSymbolsandPunctuation" "CJKCompatibilityForms" "CJKCompatibility" "EnclosedCJKLettersandMonths" "CJKUnifiedIdeographsExtensionA" "CJKUnifiedIdeographsExtensionB" "CJKUnifiedIdeographsExtensionC" "CJKUnifiedIdeographsExtensionD" "CJKUnifiedIdeographsExtensionE" "CJKUnifiedIdeographsExtensionF")
rare_str_range_values=("19968,40959" "63744,64255" "194560,195103" "12032,12255" "11904,12031" "12272,12287" "12544,12591" "12704,12735" "12736,12783" "12288,12351" "65072,65103" "13056,13311" "12800,13055" "13312,19903" "131072,173791" "173824,177977" "177984,178205" "178208,183969" "183984,191456")
final_rare_input=""

LOG_INFO() {
local content=${1}
echo -e "\033[32m[INFO] ${content}\033[0m"
}

LOG_ERROR() {
local content=${1}
echo -e "\033[31m[ERROR] ${content}\033[0m"
}

download_rare_string_jar() {
curl -LOs "https://github.com/FISCO-BCOS/LargeFiles/raw/master/binaries/jar/get-rare-string-with-unicode.jar"
}

getRangeValues() {
local rangeValue=$1
IFS=',' read -r startValue endValue <<<"$rangeValue"

echo "$startValue $endValue"
}

getConcatenatedRareStringWithRange() {
local startUnicode=${1}
local endUnicode=${2}

# concatenate strings with begin middle end
local concatenatedString
concatenatedString=$(java -cp './get-rare-string-with-unicode.jar' org.example.Main ${startUnicode})
local midUnicode=$((($startUnicode + $endUnicode) / 2))
for ((i = midUnicode; i <= midUnicode + 5; i++)); do
local currentRareString
currentRareString=$(java -cp './get-rare-string-with-unicode.jar' org.example.Main ${i})
concatenatedString+="$currentRareString"
done
local endRareString
endRareString=$(java -cp './get-rare-string-with-unicode.jar' org.example.Main ${endUnicode})
concatenatedString+="$endRareString"
echo "$concatenatedString"
}

get_rare_string() {
download_rare_string_jar
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

for ((i = 0; i < ${#rare_str_range_names[@]}; i++)); do
range_name="${rare_str_range_names[$i]}"
range_value="${rare_str_range_values[$i]}"

read -r start_value end_value <<<$(getRangeValues "${range_value}")
concatenated=$(getConcatenatedRareStringWithRange $start_value $end_value)
final_rare_input+="${concatenated}"
done
}

main() {
get_rare_string
echo "${final_rare_input}"
}

main
10 changes: 7 additions & 3 deletions .github/workflows/ci_check_bcos3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ jobs:
with:
mysql root password: '123456'
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y mysql-client git curl libssl-dev default-jdk build-essential
run: sudo apt-get update && sudo apt-get install -y mysql-client git curl libssl-dev build-essential
- name: Verify MySQL connection from host
run: |
sudo apt-get install -y mysql-client
mysql -u root --password=123456 -h 127.0.0.1 -P 3306 -e 'status;'
mysql --host 127.0.0.1 --port 3306 -uroot -p123456 -e "SHOW DATABASES"

- name: Set up JDK 1.8.0.382
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8.0.382'
- name: run ci_cross_bcos3_demo_check.sh
# The script only use ${1} as branch name. if GITHUB_BASE_REF is blank use GITHUB_REF
run: bash -x .ci/ci_cross_bcos3_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/}
run: java -version && bash -x .ci/ci_cross_bcos3_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/}
env:
CI_DB_PASSWORD : '123456'
Loading
Loading