xref: /freebsd/tests/sys/geom/class/uzip/1_test.sh (revision 2e3507c25e42292b45a5482e116d278f5515d04d)
1#!/bin/sh
2
3testsdir=$(dirname $0)
4. $testsdir/conf.sh
5
6# Check host endianness
7ret=$(echo I | tr -d "[:space:]" | od -to2 | head -n1 | awk '{print $2}' | cut -c6)
8if [ "$ret" = "1" ]; then
9	# Little endian
10	UUE=$testsdir/1_endian_little.img.uzip.uue
11elif [ "$ret" = "0" ]; then
12	# Big endian
13	UUE=$testsdir/1_endian_big.img.uzip.uue
14else
15	echo "Couldn't detect host endianness"
16	exit 2
17fi
18
19echo "1..1"
20
21uudecode $UUE
22attach_md us0 -f $(basename $UUE .uue) || exit 1
23sleep 1
24
25mount -o ro /dev/${us0}.uzip "${mntpoint}" || exit 1
26
27#cat "${mntpoint}/etalon.txt"
28diff -I '\$FreeBSD.*\$' -u $testsdir/etalon/etalon.txt "${mntpoint}/etalon.txt"
29if [ $? -eq 0 ]; then
30	echo "ok 1"
31else
32	echo "not ok 1"
33fi
34