2021-09-08 10:57:13 +08:00
|
|
|
#!/bin/bash
|
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
2021-12-11 06:46:59 +08:00
|
|
|
source _debugfs_common.sh
|
2021-12-11 06:46:46 +08:00
|
|
|
|
2021-09-08 10:57:13 +08:00
|
|
|
# Test attrs file
|
|
|
|
# ===============
|
|
|
|
|
|
|
|
file="$DBGFS/attrs"
|
|
|
|
orig_content=$(cat "$file")
|
|
|
|
|
|
|
|
test_write_succ "$file" "1 2 3 4 5" "$orig_content" "valid input"
|
|
|
|
test_write_fail "$file" "1 2 3 4" "$orig_content" "no enough fields"
|
|
|
|
test_write_fail "$file" "1 2 3 5 4" "$orig_content" \
|
|
|
|
"min_nr_regions > max_nr_regions"
|
|
|
|
test_content "$file" "$orig_content" "1 2 3 4 5" "successfully written"
|
|
|
|
echo "$orig_content" > "$file"
|