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