xref: /freebsd/tools/regression/msdosfs/msdosfstest-4.sh (revision dd41de95a84d979615a2ef11df6850622bf6184e)
1#!/bin/sh
2# $FreeBSD$
3# A really simple script to create a swap-backed msdosfs filesystem, then
4# test to see if msdosfs_conv.c rev 1.45[1] works properly.
5
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 -L uk_UA.KOI8-U -D CP866 -l /dev/md10a /tmp/msdosfstest
11# The comment is UTF-8, the actual command uses the KOI8-U representation.
12# mkdir /tmp/msdosfstest/і (CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I)
13mkdir /tmp/msdosfstest/$'\246'
14if [ $? -eq 0 ]; then
15	echo "ok 4 (pass stage 1/3)"
16	cd /tmp/msdosfstest/$'\246'
17	if [ $? -eq 0 ]; then
18		echo "ok 4 (pass stage 2/3)"
19		cd /tmp
20		umount /tmp/msdosfstest
21		mount_msdosfs -L uk_UA.KOI8-U -D CP866 -s /dev/md10a /tmp/msdosfstest
22		cd /tmp/msdosfstest/_~1
23		if [ $? -eq 0 ]; then
24			echo "ok 4 (pass stage 3/3)"
25		else
26			echo "not ok 4"
27		fi
28	else
29		echo "not ok 4"
30	fi
31else
32	echo "not ok 4"
33fi
34cd /tmp
35umount /tmp/msdosfstest
36mdconfig -d -u 10
37rmdir /tmp/msdosfstest
38