-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added folder structure for testing (#7)
* added folder structure for testing added testing.sh script added testing github action * delete rebalancing file for testing * run multiple variants of the command * fix "integer expression expected" * added assertions * output logged data
- Loading branch information
1 parent
b5fcf1a
commit d62e6e0
Showing
9 changed files
with
75 additions
and
3 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
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,19 @@ | ||
# Test | ||
|
||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
shellcheck: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run testing script | ||
run: ./testing.sh |
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 +1,4 @@ | ||
rebalance_db.txt | ||
test.log | ||
error.log | ||
rebalance_db.txt | ||
testing_data |
1 change: 1 addition & 0 deletions
1
test/pool/abc-123_!"§$%&()[]{}=?`#'*+-_,;.:|<>[email protected]
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 @@ | ||
test |
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 @@ | ||
test |
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 @@ | ||
test |
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 @@ | ||
test |
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,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
# exit script on error | ||
set -e | ||
# exit on undeclared variable | ||
set -u | ||
|
||
log_std_file=./test.log | ||
log_error_file=./error.log | ||
test_data_src=./test/pool | ||
test_pool_data_path=./testing_data | ||
|
||
function prepare() { | ||
# cleanup | ||
rm -f $log_std_file | ||
rm -f $log_error_file | ||
rm -f rebalance_db.txt | ||
rm -rf $test_pool_data_path | ||
|
||
# setup | ||
cp -rf $test_data_src $test_pool_data_path | ||
} | ||
|
||
function assertions() { | ||
# check error log is empty | ||
if grep -q '[^[:space:]]' $log_error_file; then | ||
echo "error log is not empty!" | ||
cat $log_error_file | ||
exit 1 | ||
fi | ||
} | ||
|
||
prepare | ||
./zfs-inplace-rebalancing.sh $test_pool_data_path >> $log_std_file 2>> $log_error_file | ||
cat $log_std_file | ||
assertions | ||
|
||
prepare | ||
./zfs-inplace-rebalancing.sh --checksum true --passes 1 $test_pool_data_path >> $log_std_file 2>> $log_error_file | ||
cat $log_std_file | ||
assertions | ||
|
||
prepare | ||
./zfs-inplace-rebalancing.sh --checksum false $test_pool_data_path >> $log_std_file 2>> $log_error_file | ||
cat $log_std_file | ||
assertions |
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