xref: /freebsd/tools/regression/msdosfs/msdosfstest.sh (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
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