forked from exfatprogs/exfatprogs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#setup() { | ||
# load '/usr/lib/bats/bats-assert/load.bash' | ||
#} | ||
|
||
setup_file() { | ||
# get the containing directory of this file | ||
# use $BATS_TEST_FILENAME instead of ${BASH_SOURCE[0]} or $0, | ||
# as those will point to the bats executable's location or the preprocessed file respectively | ||
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )" | ||
LOOP_DEV="/dev/loop22" | ||
#for PROG_DIR in dump exfat2img fsck label mkfs tune; do | ||
# PATH="$DIR/../../${PROG_DIR}:$PATH" | ||
#done | ||
#EXFAT_PROGS_VERSION="$(grep EXFAT_PROGS_VERSION ../../include/version.h | cut -d'"' -f 2)" | ||
EXFAT_PROGS_VERSION="1.2.0" | ||
truncate -s 100M test.img | ||
sudo mkdir -p /mnt/test | ||
sudo losetup ${LOOP_DEV} test.img | ||
sudo mkfs.exfat ${LOOP_DEV} | ||
#sudo mount -t exfat ${LOOP_DEV} /mnt/test/ | ||
} | ||
|
||
teardown_file() { | ||
#sudo umount ${LOOP_DEV} | ||
sudo losetup -d ${LOOP_DEV} | ||
sudo rmdir /mnt/test | ||
rm test.img | ||
} | ||
|
||
@test "exfatlabel get mkfs set volume serial" { | ||
run sudo exfatlabel -i ${LOOP_DEV} | ||
#assert_output -e 'volume serial : 0x[0-9a-f]+' | ||
} | ||
|
||
@test "exfatlabel set volume serial" { | ||
run sudo exfatlabel -i ${LOOP_DEV} 0xc0ffee | ||
} | ||
|
||
@test "exfatlabel get new volume serial" { | ||
run sudo exfatlabel -i ${LOOP_DEV} | ||
#assert_output -p 'volume serial : 0xc0ffee' | ||
} | ||
|
||
@test "exfatlabel set volume label-t01" { | ||
run sudo exfatlabel ${LOOP_DEV} label-t01 | ||
} | ||
|
||
@test "exfatlabel get volume label" { | ||
run sudo exfatlabel ${LOOP_DEV} | ||
#assert_output -p 'label: label-t01' | ||
} |