debugfs_target_ids.sh 671 B

12345678910111213141516171819
  1. #!/bin/bash
  2. # SPDX-License-Identifier: GPL-2.0
  3. source _debugfs_common.sh
  4. # Test target_ids file
  5. # ====================
  6. file="$DBGFS/target_ids"
  7. orig_content=$(cat "$file")
  8. test_write_succ "$file" "1 2 3 4" "$orig_content" "valid input"
  9. test_write_succ "$file" "1 2 abc 4" "$orig_content" "still valid input"
  10. test_content "$file" "$orig_content" "1 2" "non-integer was there"
  11. test_write_succ "$file" "abc 2 3" "$orig_content" "the file allows wrong input"
  12. test_content "$file" "$orig_content" "" "wrong input written"
  13. test_write_succ "$file" "" "$orig_content" "empty input"
  14. test_content "$file" "$orig_content" "" "empty input written"
  15. echo "$orig_content" > "$file"