xref: /freebsd/tools/regression/msdosfs/msdosfstest.sh (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1#!/bin/sh
2# A really simple script to create a swap-backed msdosfs filesystem, copy a few
3# files to it, unmount/remount the filesystem, and make sure all is well.
4#
5# Not very advanced, but better than nothing.
6mkdir /tmp/msdosfstest/
7mdconfig -a -t swap -s 128m -u 10
8bsdlabel -w md10 auto
9newfs_msdos -F 16 -b 8192 /dev/md10a
10mount_msdosfs /dev/md10a /tmp/msdosfstest/
11cp -R /usr/src/bin/ /tmp/msdosfstest/
12umount /tmp/msdosfstest/
13mount_msdosfs /dev/md10a /tmp/msdosfstest/
14diff -u -r /usr/src/bin /tmp/msdosfstest/
15if [ $? -eq 0 ]; then
16	echo "ok 1";
17else
18	echo "not ok 1";
19fi
20umount /tmp/msdosfstest/
21mdconfig -d -u 10
22rmdir /tmp/msdosfstest/
23