003 File Manager
Current Path:
/usr/src/usr.bin/mkimg/tests
usr
/
src
/
usr.bin
/
mkimg
/
tests
/
📁
..
📄
Makefile
(1.43 KB)
📄
Makefile.depend
(176 B)
📄
img-1x1-4096-apm.qcow.hex
(41.55 KB)
📄
img-1x1-4096-apm.qcow2.hex
(4.99 KB)
📄
img-1x1-4096-apm.raw.hex
(1.42 KB)
📄
img-1x1-4096-apm.vhd.hex
(3.29 KB)
📄
img-1x1-4096-apm.vhdf.hex
(1.97 KB)
📄
img-1x1-4096-apm.vhdx.hex
(4.61 KB)
📄
img-1x1-4096-apm.vmdk.hex
(23.66 KB)
📄
img-1x1-4096-bsd.qcow.hex
(41.39 KB)
📄
img-1x1-4096-bsd.qcow2.hex
(4.83 KB)
📄
img-1x1-4096-bsd.raw.hex
(1.27 KB)
📄
img-1x1-4096-bsd.vhd.hex
(3.13 KB)
📄
img-1x1-4096-bsd.vhdf.hex
(1.81 KB)
📄
img-1x1-4096-bsd.vhdx.hex
(4.45 KB)
📄
img-1x1-4096-bsd.vmdk.hex
(23.42 KB)
📄
img-1x1-4096-ebr.qcow.hex
(41.85 KB)
📄
img-1x1-4096-ebr.qcow2.hex
(5.14 KB)
📄
img-1x1-4096-ebr.raw.hex
(1.66 KB)
📄
img-1x1-4096-ebr.vhd.hex
(3.52 KB)
📄
img-1x1-4096-ebr.vhdf.hex
(2.2 KB)
📄
img-1x1-4096-ebr.vhdx.hex
(4.76 KB)
📄
img-1x1-4096-ebr.vmdk.hex
(23.81 KB)
📄
img-1x1-4096-gpt.qcow.hex
(43.25 KB)
📄
img-1x1-4096-gpt.qcow2.hex
(6.53 KB)
📄
img-1x1-4096-gpt.raw.hex
(2.89 KB)
📄
img-1x1-4096-gpt.vhd.hex
(4.76 KB)
📄
img-1x1-4096-gpt.vhdf.hex
(3.44 KB)
📄
img-1x1-4096-gpt.vhdx.hex
(6.08 KB)
📄
img-1x1-4096-gpt.vmdk.hex
(25.44 KB)
📄
img-1x1-4096-mbr.qcow.hex
(41.93 KB)
📄
img-1x1-4096-mbr.qcow2.hex
(5.22 KB)
📄
img-1x1-4096-mbr.raw.hex
(1.66 KB)
📄
img-1x1-4096-mbr.vhd.hex
(3.52 KB)
📄
img-1x1-4096-mbr.vhdf.hex
(2.2 KB)
📄
img-1x1-4096-mbr.vhdx.hex
(4.84 KB)
📄
img-1x1-4096-mbr.vmdk.hex
(23.89 KB)
📄
img-1x1-4096-vtoc8.qcow.hex
(41.39 KB)
📄
img-1x1-4096-vtoc8.qcow2.hex
(4.75 KB)
📄
img-1x1-4096-vtoc8.raw.hex
(1.19 KB)
📄
img-1x1-4096-vtoc8.vhd.hex
(3.05 KB)
📄
img-1x1-4096-vtoc8.vhdf.hex
(1.73 KB)
📄
img-1x1-4096-vtoc8.vhdx.hex
(4.37 KB)
📄
img-1x1-4096-vtoc8.vmdk.hex
(23.42 KB)
📄
img-1x1-512-apm.qcow.hex
(41.63 KB)
📄
img-1x1-512-apm.qcow2.hex
(4.99 KB)
📄
img-1x1-512-apm.raw.hex
(1.42 KB)
📄
img-1x1-512-apm.vhd.hex
(3.29 KB)
📄
img-1x1-512-apm.vhdf.hex
(1.97 KB)
📄
img-1x1-512-apm.vhdx.hex
(4.61 KB)
📄
img-1x1-512-apm.vmdk.hex
(23.66 KB)
📄
img-1x1-512-bsd.qcow.hex
(41.39 KB)
📄
img-1x1-512-bsd.qcow2.hex
(4.83 KB)
📄
img-1x1-512-bsd.raw.hex
(1.27 KB)
📄
img-1x1-512-bsd.vhd.hex
(3.13 KB)
📄
img-1x1-512-bsd.vhdf.hex
(1.81 KB)
📄
img-1x1-512-bsd.vhdx.hex
(4.45 KB)
📄
img-1x1-512-bsd.vmdk.hex
(23.42 KB)
📄
img-1x1-512-ebr.qcow.hex
(41.85 KB)
📄
img-1x1-512-ebr.qcow2.hex
(5.14 KB)
📄
img-1x1-512-ebr.raw.hex
(1.66 KB)
📄
img-1x1-512-ebr.vhd.hex
(3.52 KB)
📄
img-1x1-512-ebr.vhdf.hex
(2.2 KB)
📄
img-1x1-512-ebr.vhdx.hex
(4.76 KB)
📄
img-1x1-512-ebr.vmdk.hex
(23.81 KB)
📄
img-1x1-512-gpt.qcow.hex
(43.25 KB)
📄
img-1x1-512-gpt.qcow2.hex
(6.53 KB)
📄
img-1x1-512-gpt.raw.hex
(2.89 KB)
📄
img-1x1-512-gpt.vhd.hex
(4.76 KB)
📄
img-1x1-512-gpt.vhdf.hex
(3.44 KB)
📄
img-1x1-512-gpt.vhdx.hex
(6.08 KB)
📄
img-1x1-512-gpt.vmdk.hex
(25.44 KB)
📄
img-1x1-512-mbr.qcow.hex
(41.93 KB)
📄
img-1x1-512-mbr.qcow2.hex
(5.22 KB)
📄
img-1x1-512-mbr.raw.hex
(1.66 KB)
📄
img-1x1-512-mbr.vhd.hex
(3.52 KB)
📄
img-1x1-512-mbr.vhdf.hex
(2.2 KB)
📄
img-1x1-512-mbr.vhdx.hex
(4.84 KB)
📄
img-1x1-512-mbr.vmdk.hex
(23.89 KB)
📄
img-1x1-512-vtoc8.qcow.hex
(41.39 KB)
📄
img-1x1-512-vtoc8.qcow2.hex
(4.75 KB)
📄
img-1x1-512-vtoc8.raw.hex
(1.19 KB)
📄
img-1x1-512-vtoc8.vhd.hex
(3.05 KB)
📄
img-1x1-512-vtoc8.vhdf.hex
(1.73 KB)
📄
img-1x1-512-vtoc8.vhdx.hex
(4.37 KB)
📄
img-1x1-512-vtoc8.vmdk.hex
(23.42 KB)
📄
img-63x255-4096-apm.qcow.hex
(41.55 KB)
📄
img-63x255-4096-apm.qcow2.hex
(4.99 KB)
📄
img-63x255-4096-apm.raw.hex
(1.42 KB)
📄
img-63x255-4096-apm.vhd.hex
(3.29 KB)
📄
img-63x255-4096-apm.vhdf.hex
(1.97 KB)
📄
img-63x255-4096-apm.vhdx.hex
(4.61 KB)
📄
img-63x255-4096-apm.vmdk.hex
(23.66 KB)
📄
img-63x255-4096-bsd.qcow.hex
(41.39 KB)
📄
img-63x255-4096-bsd.qcow2.hex
(4.83 KB)
📄
img-63x255-4096-bsd.raw.hex
(1.27 KB)
📄
img-63x255-4096-bsd.vhd.hex
(3.13 KB)
📄
img-63x255-4096-bsd.vhdf.hex
(1.81 KB)
📄
img-63x255-4096-bsd.vhdx.hex
(4.45 KB)
📄
img-63x255-4096-bsd.vmdk.hex
(23.42 KB)
📄
img-63x255-4096-ebr.qcow.hex
(42.09 KB)
📄
img-63x255-4096-ebr.qcow2.hex
(5.22 KB)
📄
img-63x255-4096-ebr.raw.hex
(1.74 KB)
📄
img-63x255-4096-ebr.vhd.hex
(3.6 KB)
📄
img-63x255-4096-ebr.vhdf.hex
(2.28 KB)
📄
img-63x255-4096-ebr.vhdx.hex
(4.84 KB)
📄
img-63x255-4096-ebr.vmdk.hex
(24.04 KB)
📄
img-63x255-4096-gpt.qcow.hex
(43.25 KB)
📄
img-63x255-4096-gpt.qcow2.hex
(6.53 KB)
📄
img-63x255-4096-gpt.raw.hex
(2.89 KB)
📄
img-63x255-4096-gpt.vhd.hex
(4.92 KB)
📄
img-63x255-4096-gpt.vhdf.hex
(3.44 KB)
📄
img-63x255-4096-gpt.vhdx.hex
(6.08 KB)
📄
img-63x255-4096-gpt.vmdk.hex
(25.44 KB)
📄
img-63x255-4096-mbr.qcow.hex
(42.17 KB)
📄
img-63x255-4096-mbr.qcow2.hex
(5.3 KB)
📄
img-63x255-4096-mbr.raw.hex
(1.74 KB)
📄
img-63x255-4096-mbr.vhd.hex
(3.6 KB)
📄
img-63x255-4096-mbr.vhdf.hex
(2.28 KB)
📄
img-63x255-4096-mbr.vhdx.hex
(4.92 KB)
📄
img-63x255-4096-mbr.vmdk.hex
(24.12 KB)
📄
img-63x255-4096-vtoc8.qcow.hex
(41.7 KB)
📄
img-63x255-4096-vtoc8.qcow2.hex
(4.98 KB)
📄
img-63x255-4096-vtoc8.raw.hex
(1.26 KB)
📄
img-63x255-4096-vtoc8.vhd.hex
(3.37 KB)
📄
img-63x255-4096-vtoc8.vhdf.hex
(1.81 KB)
📄
img-63x255-4096-vtoc8.vhdx.hex
(4.45 KB)
📄
img-63x255-4096-vtoc8.vmdk.hex
(23.96 KB)
📄
img-63x255-512-apm.qcow.hex
(41.63 KB)
📄
img-63x255-512-apm.qcow2.hex
(4.99 KB)
📄
img-63x255-512-apm.raw.hex
(1.42 KB)
📄
img-63x255-512-apm.vhd.hex
(3.29 KB)
📄
img-63x255-512-apm.vhdf.hex
(1.97 KB)
📄
img-63x255-512-apm.vhdx.hex
(4.61 KB)
📄
img-63x255-512-apm.vmdk.hex
(23.66 KB)
📄
img-63x255-512-bsd.qcow.hex
(41.39 KB)
📄
img-63x255-512-bsd.qcow2.hex
(4.83 KB)
📄
img-63x255-512-bsd.raw.hex
(1.27 KB)
📄
img-63x255-512-bsd.vhd.hex
(3.13 KB)
📄
img-63x255-512-bsd.vhdf.hex
(1.81 KB)
📄
img-63x255-512-bsd.vhdx.hex
(4.45 KB)
📄
img-63x255-512-bsd.vmdk.hex
(23.42 KB)
📄
img-63x255-512-ebr.qcow.hex
(42.09 KB)
📄
img-63x255-512-ebr.qcow2.hex
(5.22 KB)
📄
img-63x255-512-ebr.raw.hex
(1.74 KB)
📄
img-63x255-512-ebr.vhd.hex
(3.6 KB)
📄
img-63x255-512-ebr.vhdf.hex
(2.28 KB)
📄
img-63x255-512-ebr.vhdx.hex
(4.84 KB)
📄
img-63x255-512-ebr.vmdk.hex
(24.04 KB)
📄
img-63x255-512-gpt.qcow.hex
(43.25 KB)
📄
img-63x255-512-gpt.qcow2.hex
(6.53 KB)
📄
img-63x255-512-gpt.raw.hex
(2.89 KB)
📄
img-63x255-512-gpt.vhd.hex
(4.92 KB)
📄
img-63x255-512-gpt.vhdf.hex
(3.44 KB)
📄
img-63x255-512-gpt.vhdx.hex
(6.08 KB)
📄
img-63x255-512-gpt.vmdk.hex
(25.44 KB)
📄
img-63x255-512-mbr.qcow.hex
(42.17 KB)
📄
img-63x255-512-mbr.qcow2.hex
(5.3 KB)
📄
img-63x255-512-mbr.raw.hex
(1.74 KB)
📄
img-63x255-512-mbr.vhd.hex
(3.6 KB)
📄
img-63x255-512-mbr.vhdf.hex
(2.28 KB)
📄
img-63x255-512-mbr.vhdx.hex
(4.92 KB)
📄
img-63x255-512-mbr.vmdk.hex
(24.12 KB)
📄
img-63x255-512-vtoc8.qcow.hex
(41.7 KB)
📄
img-63x255-512-vtoc8.qcow2.hex
(4.98 KB)
📄
img-63x255-512-vtoc8.raw.hex
(1.26 KB)
📄
img-63x255-512-vtoc8.vhd.hex
(3.37 KB)
📄
img-63x255-512-vtoc8.vhdf.hex
(1.81 KB)
📄
img-63x255-512-vtoc8.vhdx.hex
(4.45 KB)
📄
img-63x255-512-vtoc8.vmdk.hex
(23.96 KB)
📄
mkimg_test.sh
(2.93 KB)
Editing: mkimg_test.sh
# $FreeBSD$ mkimg_blksz_list="512 4096" mkimg_format_list="qcow qcow2 raw vhd vhdf vhdx vmdk" mkimg_geom_list="1x1 63x255" mkimg_scheme_list="apm bsd ebr gpt mbr vtoc8" bootcode() { case $1 in bsd) echo 8192 ;; gpt|mbr) echo 512 ;; *) echo 0 ;; esac return 0 } mkcontents() { local byte count name byte=$1 count=$2 name=_tmp-$byte-$count.bin jot -b $byte $(($count/2)) > $name echo $name return 0 } makeimage() { local blksz bootarg bootsz format geom nhds nsecs partarg pfx scheme format=$1 scheme=$2 blksz=$3 geom=$4 pfx=$5 shift 5 nsecs=${geom%x*} nhds=${geom#*x} bootsz=`bootcode $scheme` if test $bootsz -gt 0; then bootarg="-b `mkcontents B $bootsz`" else bootarg="" fi partarg="" for P in $*; do partarg="$partarg -p $P" done if test -z "$partarg"; then local swap ufs swap="-p freebsd-swap::128K" ufs="-p freebsd-ufs:=$(atf_get_srcdir)/partition_data_4M.bin" partarg="$ufs $swap" fi imagename=$pfx-$geom-$blksz-$scheme.$format mkimg -y -f $format -o $imagename -s $scheme -P $blksz -H $nhds -T $nsecs \ $bootarg $partarg echo $imagename return 0 } mkimg_rebase() { local baseline image result tmpfile update image=$1 result=$2 baseline=$image.hex update=yes if test -f $baseline; then tmpfile=_tmp-baseline sed -e '/^#.*/D' < $baseline > $tmpfile if diff -u $tmpfile $result; then update=no fi fi if test $update = yes; then # Prevent keyword expansion when writing the keyword. (echo -n '# $'; echo -n FreeBSD; echo '$') > $baseline cat $result >> $baseline fi rm $image $result _tmp-* return 0 } mkimg_test() { local blksz format geom scheme geom=$1 blksz=$2 scheme=$3 format=$4 case $scheme in ebr|mbr) bsd=`makeimage raw bsd $blksz $geom _tmp` partinfo="freebsd:=$bsd" ;; *) partinfo="" ;; esac image=`makeimage $format $scheme $blksz $geom img $partinfo` result=$image.out hexdump -C $image > $result if test "x$mkimg_update_baseline" = "xyes"; then mkimg_rebase $image $result else baseline=`atf_get_srcdir`/$image atf_check -s exit:0 diff -u $baseline $result fi return 0 } atf_test_case rebase rebase_body() { local nm mkimg_update_baseline=yes for nm in $mkimg_tests; do ${nm}_body done return 0 } atf_init_test_cases() { local B F G S nm for G in $mkimg_geom_list; do for B in $mkimg_blksz_list; do for S in $mkimg_scheme_list; do for F in $mkimg_format_list; do nm="${S}_${G}_${B}_${F}" atf_test_case $nm eval "${nm}_body() { mkimg_test $G $B $S $F; }" mkimg_tests="${mkimg_tests} ${nm}" atf_add_test_case $nm done done done done # XXX hack to make updating the baseline easier if test "${__RUNNING_INSIDE_ATF_RUN}" != "internal-yes-value"; then atf_add_test_case rebase fi }
Upload File
Create Folder