-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'readonly-trim' of https://github.com/vincentkfu/fio
* 'readonly-trim' of https://github.com/vincentkfu/fio: testing: add test script for readonly parameter doc: improve readonly option description options: check for conflict between trims and readonly option init: abort write and trim jobs when --readonly option is present init: ensure that fatal errors in fixup_options are always propogated to caller filesetup: make trim jobs respect --readonly during file open fio.h: also check trim operations in fio_ro_check
- Loading branch information
Showing
10 changed files
with
139 additions
and
33 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
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,5 @@ | ||
[test] | ||
filename=${DUT} | ||
rw=randread | ||
time_based | ||
runtime=1s |
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,5 @@ | ||
[test] | ||
filename=${DUT} | ||
rw=randtrim | ||
time_based | ||
runtime=1s |
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,5 @@ | ||
[test] | ||
filename=${DUT} | ||
rw=randwrite | ||
time_based | ||
runtime=1s |
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,84 @@ | ||
#!/bin/bash | ||
# | ||
# Do some basic test of the --readonly parameter | ||
# | ||
# DUT should be a device that accepts read, write, and trim operations | ||
# | ||
# Example usage: | ||
# | ||
# DUT=/dev/fioa t/readonly.sh | ||
# | ||
TESTNUM=1 | ||
|
||
# | ||
# The first parameter is the return code | ||
# The second parameter is 0 if the return code should be 0 | ||
# positive if the return code should be positive | ||
# | ||
check () { | ||
echo "********************" | ||
|
||
if [ $2 -gt 0 ]; then | ||
if [ $1 -eq 0 ]; then | ||
echo "Test $TESTNUM failed" | ||
echo "********************" | ||
exit 1 | ||
else | ||
echo "Test $TESTNUM passed" | ||
fi | ||
else | ||
if [ $1 -gt 0 ]; then | ||
echo "Test $TESTNUM failed" | ||
echo "********************" | ||
exit 1 | ||
else | ||
echo "Test $TESTNUM passed" | ||
fi | ||
fi | ||
|
||
echo "********************" | ||
echo | ||
TESTNUM=$((TESTNUM+1)) | ||
} | ||
|
||
./fio --name=test --filename=$DUT --rw=randread --readonly --time_based --runtime=1s &> /dev/null | ||
check $? 0 | ||
./fio --name=test --filename=$DUT --rw=randwrite --readonly --time_based --runtime=1s &> /dev/null | ||
check $? 1 | ||
./fio --name=test --filename=$DUT --rw=randtrim --readonly --time_based --runtime=1s &> /dev/null | ||
check $? 1 | ||
|
||
./fio --name=test --filename=$DUT --readonly --rw=randread --time_based --runtime=1s &> /dev/null | ||
check $? 0 | ||
./fio --name=test --filename=$DUT --readonly --rw=randwrite --time_based --runtime=1s &> /dev/null | ||
check $? 1 | ||
./fio --name=test --filename=$DUT --readonly --rw=randtrim --time_based --runtime=1s &> /dev/null | ||
check $? 1 | ||
|
||
./fio --name=test --filename=$DUT --rw=randread --time_based --runtime=1s &> /dev/null | ||
check $? 0 | ||
./fio --name=test --filename=$DUT --rw=randwrite --time_based --runtime=1s &> /dev/null | ||
check $? 0 | ||
./fio --name=test --filename=$DUT --rw=randtrim --time_based --runtime=1s &> /dev/null | ||
check $? 0 | ||
|
||
./fio t/jobs/readonly-r.fio --readonly &> /dev/null | ||
check $? 0 | ||
./fio t/jobs/readonly-w.fio --readonly &> /dev/null | ||
check $? 1 | ||
./fio t/jobs/readonly-t.fio --readonly &> /dev/null | ||
check $? 1 | ||
|
||
./fio --readonly t/jobs/readonly-r.fio &> /dev/null | ||
check $? 0 | ||
./fio --readonly t/jobs/readonly-w.fio &> /dev/null | ||
check $? 1 | ||
./fio --readonly t/jobs/readonly-t.fio &> /dev/null | ||
check $? 1 | ||
|
||
./fio t/jobs/readonly-r.fio &> /dev/null | ||
check $? 0 | ||
./fio t/jobs/readonly-w.fio &> /dev/null | ||
check $? 0 | ||
./fio t/jobs/readonly-t.fio &> /dev/null | ||
check $? 0 |