toybox/tests/losetup.test
Elliott Hughes bfbdd4a2db Use return rather than continue to make bash 4.4 happy.
Otherwise we get this error:

  continue: only meaningful in a 'for', 'while', or 'until' loop
2019-01-07 19:26:24 -06:00

26 lines
435 B
Bash
Executable File

#!/bin/bash
[ -f testing.sh ] && . testing.sh
if [ "$(id -u)" -ne 0 ]
then
echo "$SHOWSKIP: losetup (not root)"
return 2>/dev/null
exit
fi
#testing "name" "command" "result" "infile" "stdin"
truncate -s 1M blah.img &&
FILE="$(readlink -f blah.img)"
DEV="$(printf '%04s' $(stat -t blah.img | awk '{print $7}'))"
NODE="$(stat -t blah.img | awk '{print $8}')"
losetup -f
losetup -f -s
losetup -f file
losetup -d
rm blah.img