This repository has been archived by the owner on Jun 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from darrenldl/dev
Multihash overhaul, help/warning messages improvement
- Loading branch information
Showing
19 changed files
with
690 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
dd if=/dev/urandom of=dummy bs=$[1024 * 2] count=1 &>/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/bin/bash | ||
|
||
source kcov_rsbx_fun.sh | ||
|
||
exit_code=0 | ||
|
||
VERSIONS=(1 2 3 17 18 19) | ||
|
||
# Encode in all 6 versions | ||
for ver in ${VERSIONS[*]}; do | ||
echo -n "Encoding in version $ver" | ||
output=$(kcov_rsbx encode --json --sbx-version $ver -f dummy dummy$ver.sbx \ | ||
--rs-data 10 --rs-parity 2) | ||
if [[ $(echo $output | jq -r ".error") != null ]]; then | ||
echo " ==> Invalid JSON" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".stats.sbxVersion") == "$ver" ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
done | ||
|
||
# Check all of them | ||
for ver in ${VERSIONS[*]}; do | ||
echo -n "Checking version $ver container" | ||
output=$(kcov_rsbx check --json --pv 2 --verbose dummy$ver.sbx 2>/dev/null) | ||
if [[ $(echo $output | jq -r ".error") != null ]]; then | ||
echo " ==> Invalid JSON" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".stats.numberOfBlocksFailedCheck") == 0 ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
done | ||
|
||
# Show all | ||
for ver in ${VERSIONS[*]}; do | ||
echo -n "Checking show output for $ver container" | ||
output=$(kcov_rsbx show --json --pv 1 dummy$ver.sbx 2>/dev/null) | ||
if [[ $(echo $output | jq -r ".error") != null ]]; then | ||
echo " ==> Invalid JSON" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".blocks[0].sbxContainerVersion") == $ver ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
done | ||
|
||
# Decode all of them | ||
for ver in ${VERSIONS[*]}; do | ||
echo -n "Decoding version $ver container" | ||
output=$(kcov_rsbx decode --json --verbose dummy$ver.sbx - 2>&1 > dummy$ver) | ||
if [[ $(echo $output | jq -r ".error") != null ]]; then | ||
echo " ==> Invalid JSON" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".stats.sbxVersion") == "$ver" ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
done | ||
|
||
# Compare to original file | ||
for ver in ${VERSIONS[*]}; do | ||
echo -n "Comparing decoded version $ver container data to original" | ||
cmp dummy dummy$ver | ||
if [[ $? == 0 ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
done | ||
|
||
exit $exit_code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/bash | ||
|
||
source kcov_rsbx_fun.sh | ||
|
||
exit_code=0 | ||
|
||
VERSIONS=(1 2 3 17 18 19) | ||
|
||
# Encode in all 6 versions | ||
for ver in ${VERSIONS[*]}; do | ||
echo -n "Encoding in version $ver" | ||
output=$(cat dummy | \ | ||
kcov_rsbx encode --json --sbx-version $ver -f - dummy$ver.sbx \ | ||
--rs-data 10 --rs-parity 2) | ||
if [[ $(echo $output | jq -r ".error") != null ]]; then | ||
echo " ==> Invalid JSON" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".stats.sbxVersion") == "$ver" ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
done | ||
|
||
# Check all of them | ||
for ver in ${VERSIONS[*]}; do | ||
echo -n "Checking version $ver container" | ||
output=$(kcov_rsbx check --json --pv 2 --verbose dummy$ver.sbx 2>/dev/null) | ||
if [[ $(echo $output | jq -r ".error") != null ]]; then | ||
echo " ==> Invalid JSON" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".stats.numberOfBlocksFailedCheck") == 0 ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
done | ||
|
||
# Show all | ||
for ver in ${VERSIONS[*]}; do | ||
echo -n "Checking show output for $ver container" | ||
output=$(kcov_rsbx show --json --pv 1 dummy$ver.sbx 2>/dev/null) | ||
if [[ $(echo $output | jq -r ".error") != null ]]; then | ||
echo " ==> Invalid JSON" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".blocks[0].sbxContainerVersion") == $ver ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
done | ||
|
||
# Decode all of them | ||
for ver in ${VERSIONS[*]}; do | ||
echo -n "Decoding version $ver container" | ||
output=$(kcov_rsbx decode --json --verbose -f dummy$ver.sbx dummy$ver) | ||
if [[ $(echo $output | jq -r ".error") != null ]]; then | ||
echo " ==> Invalid JSON" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".stats.sbxVersion") == "$ver" ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
done | ||
|
||
# Compare to original file | ||
for ver in ${VERSIONS[*]}; do | ||
echo -n "Comparing decoded version $ver container data to original" | ||
cmp dummy dummy$ver | ||
if [[ $? == 0 ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
done | ||
|
||
exit $exit_code |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.