1 #!/bin/bash 2 3 [ -f testing.sh ] && . testing.sh 4 5 if [ "$(id -u)" -ne 0 ] 6 then 7 echo "$SHOWSKIP: losetup (not root)" 8 continue 2>/dev/null 9 exit 10 fi 11 12 #testing "name" "command" "result" "infile" "stdin" 13 14 truncate -s 1M blah.img && 15 FILE="$(readlink -f blah.img)" 16 DEV="$(printf '%04d' $(stat -t blah.img | awk '{print $7}'))" 17 NODE="$(awk '{print $7}')" 18 19 losetup -f 20 losetup -f -s 21 losetup -f file 22 23 losetup -d 24 25 rm blah.img 26