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