diff options
Diffstat (limited to 'tools/testing/selftests/firmware/fw_filesystem.sh')
-rwxr-xr-x | tools/testing/selftests/firmware/fw_filesystem.sh | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh index f901076aa2ea..56894477c8bd 100755 --- a/tools/testing/selftests/firmware/fw_filesystem.sh +++ b/tools/testing/selftests/firmware/fw_filesystem.sh @@ -116,6 +116,16 @@ config_set_name() echo -n $1 > $DIR/config_name } +config_set_into_buf() +{ + echo 1 > $DIR/config_into_buf +} + +config_unset_into_buf() +{ + echo 0 > $DIR/config_into_buf +} + config_set_sync_direct() { echo 1 > $DIR/config_sync_direct @@ -153,11 +163,14 @@ config_set_read_fw_idx() read_firmwares() { - if [ "$1" = "xzonly" ]; then - fwfile="${FW}-orig" + if [ "$(cat $DIR/config_into_buf)" == "1" ]; then + fwfile="$FW_INTO_BUF" else fwfile="$FW" fi + if [ "$1" = "xzonly" ]; then + fwfile="${fwfile}-orig" + fi for i in $(seq 0 3); do config_set_read_fw_idx $i # Verify the contents are what we expect. @@ -194,6 +207,18 @@ test_batched_request_firmware_nofile() echo "OK" } +test_batched_request_firmware_into_buf_nofile() +{ + echo -n "Batched request_firmware_into_buf() nofile try #$1: " + config_reset + config_set_name nope-test-firmware.bin + config_set_into_buf + config_trigger_sync + read_firmwares_expect_nofile + release_all_firmware + echo "OK" +} + test_batched_request_firmware_direct_nofile() { echo -n "Batched request_firmware_direct() nofile try #$1: " @@ -259,6 +284,18 @@ test_batched_request_firmware() echo "OK" } +test_batched_request_firmware_into_buf() +{ + echo -n "Batched request_firmware_into_buf() $2 try #$1: " + config_reset + config_set_name $TEST_FIRMWARE_INTO_BUF_FILENAME + config_set_into_buf + config_trigger_sync + read_firmwares $2 + release_all_firmware + echo "OK" +} + test_batched_request_firmware_direct() { echo -n "Batched request_firmware_direct() $2 try #$1: " @@ -308,6 +345,10 @@ for i in $(seq 1 5); do done for i in $(seq 1 5); do + test_batched_request_firmware_into_buf $i normal +done + +for i in $(seq 1 5); do test_batched_request_firmware_direct $i normal done @@ -328,6 +369,10 @@ for i in $(seq 1 5); do done for i in $(seq 1 5); do + test_batched_request_firmware_into_buf_nofile $i +done + +for i in $(seq 1 5); do test_batched_request_firmware_direct_nofile $i done @@ -351,6 +396,10 @@ for i in $(seq 1 5); do done for i in $(seq 1 5); do + test_batched_request_firmware_into_buf $i both +done + +for i in $(seq 1 5); do test_batched_request_firmware_direct $i both done @@ -371,6 +420,10 @@ for i in $(seq 1 5); do done for i in $(seq 1 5); do + test_batched_request_firmware_into_buf $i xzonly +done + +for i in $(seq 1 5); do test_batched_request_firmware_direct $i xzonly done |