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 #110 from darrenldl/dev
Added --only-pick-uid to show mode, replaced uid with UID in output text
- Loading branch information
Showing
13 changed files
with
284 additions
and
18 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "blkar" | ||
version = "2.1.0" | ||
version = "2.2.0" | ||
authors = ["Darren Ldl <[email protected]>"] | ||
build = "build.rs" | ||
exclude = [ | ||
|
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
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,97 @@ | ||
#!/bin/bash | ||
|
||
exit_code=0 | ||
|
||
echo "Creating empty files" | ||
touch dummy_empty1 | ||
touch dummy_empty2 | ||
|
||
echo -n "Encoding 1st file" | ||
output=$(./blkar encode --json -f dummy_empty1 --uid DEADBEEF0001) | ||
if [[ $(echo $output | jq -r ".error") != null ]]; then | ||
echo " ==> Invalid JSON" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".stats.fileUID") == "DEADBEEF0001" ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
|
||
echo -n "Encoding 2nd file" | ||
output=$(./blkar encode --json -f dummy_empty2 --uid DEADBEEF0002) | ||
if [[ $(echo $output | jq -r ".error") != null ]]; then | ||
echo " ==> Invalid JSON" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".stats.fileUID") == "DEADBEEF0002" ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
|
||
echo "Crafting dummy disk file" | ||
rm dummy_empty_disk &>/dev/null | ||
cat dummy_empty1.sbx >> dummy_empty_disk | ||
cat dummy_empty2.sbx >> dummy_empty_disk | ||
|
||
echo -n "Checking that blkar only shows first block" | ||
output=$(./blkar show --json --show-all dummy_empty_disk --from 0 --to 511) | ||
if [[ $(echo $output | jq -r ".error") != "null" ]]; then | ||
echo " ==> Invalid JSON" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".blocks[0].fileUID") == "DEADBEEF0001" ]]; then | ||
echo -n " ==> Okay" | ||
else | ||
echo -n " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".blocks[1]") == "null" ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
|
||
echo -n "Checking that blkar only shows second block" | ||
output=$(./blkar show --json --show-all dummy_empty_disk --from 512 --to 512) | ||
if [[ $(echo $output | jq -r ".error") != "null" ]]; then | ||
echo " ==> Invalid JSON" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".blocks[0].fileUID") == "DEADBEEF0002" ]]; then | ||
echo -n " ==> Okay" | ||
else | ||
echo -n " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".blocks[1]") == "null" ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
|
||
echo -n "Checking that blkar shows both blocks" | ||
output=$(./blkar show --json --show-all dummy_empty_disk) | ||
if [[ $(echo $output | jq -r ".error") != "null" ]]; then | ||
echo " ==> Invalid JSON" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".blocks[0].fileUID") == "DEADBEEF0001" ]]; then | ||
echo -n " ==> Okay" | ||
else | ||
echo -n " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
if [[ $(echo $output | jq -r ".blocks[1].fileUID") == "DEADBEEF0002" ]]; then | ||
echo " ==> Okay" | ||
else | ||
echo " ==> NOT okay" | ||
exit_code=1 | ||
fi | ||
|
||
exit $exit_code |
Oops, something went wrong.