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