Add testing for NTFS (working) and EXT* (not working)

pull/10/head
Raphaël Vinot 2014-10-01 14:00:41 +02:00
parent 23a93fe63b
commit d3e18d2dcb
2 changed files with 61 additions and 10 deletions

View File

@ -5,28 +5,36 @@
set -e set -e
set -x set -x
# User FS_EXT='ext2 ext3 ext4'
#FS_EXT='ext2 ext3 ext4'
FS_VFAT='vfat' FS_VFAT='vfat'
#FS_NTFS='ntfs' FS_NTFS='ntfs'
SIZE_MB='128' SIZE_MB='128'
# System # System
FS="${FS_EXT} ${FS_VFAT} ${FS_NTFS}" FS="${FS_EXT} ${FS_VFAT} ${FS_NTFS}"
IMAGE_DEST="testcase_dest.vfat"
dd if=/dev/zero of=${IMAGE_DEST} bs=516096c count=200
parted -s ${IMAGE_DEST} mklabel msdos
parted -s ${IMAGE_DEST} mkpart primary 8192s 201599s
lo=`losetup -f`
losetup -o$((8192 * 512)) ${lo} ${IMAGE_DEST}
mkfs.vfat ${lo}
losetup -d ${lo}
for f in $FS; do for f in $FS; do
# Create files of 128Mb # Create files of 128Mb
OUT_NAME_NORM="testcase."${f} OUT_NAME_NORM="testcase."${f}
OUT_NAME_PART="testcase.part."${f}
dd if=/dev/zero of=${OUT_NAME_NORM} bs=516096c count=200 dd if=/dev/zero of=${OUT_NAME_NORM} bs=516096c count=200
dd if=/dev/zero of=${OUT_NAME_PART} bs=516096c count=200
parted -s ${OUT_NAME_NORM} mklabel msdos parted -s ${OUT_NAME_NORM} mklabel msdos
parted -s ${OUT_NAME_PART} mklabel msdos
if [ $f = ${FS_VFAT} ]; then if [ $f = ${FS_VFAT} ]; then
OUT_NAME_PART="testcase.part."${f}
dd if=/dev/zero of=${OUT_NAME_PART} bs=516096c count=200
parted -s ${OUT_NAME_PART} mklabel msdos
parted -s ${OUT_NAME_PART} mkpart primary 8192s 122879s parted -s ${OUT_NAME_PART} mkpart primary 8192s 122879s
parted -s ${OUT_NAME_PART} mkpart primary 122880s 201599s parted -s ${OUT_NAME_PART} mkpart primary 122880s 201599s
parted -s ${OUT_NAME_NORM} mkpart primary 8192s 201599s
lo=`losetup -f` lo=`losetup -f`
losetup -o$((8192 * 512)) ${lo} ${OUT_NAME_PART} losetup -o$((8192 * 512)) ${lo} ${OUT_NAME_PART}
mkfs.${f} ${lo} 57344 mkfs.${f} ${lo} 57344
@ -34,13 +42,23 @@ for f in $FS; do
losetup -o$((122880 * 512)) ${lo} ${OUT_NAME_PART} losetup -o$((122880 * 512)) ${lo} ${OUT_NAME_PART}
mkfs.${f} ${lo} 39360 mkfs.${f} ${lo} 39360
losetup -d ${lo} losetup -d ${lo}
parted -s ${OUT_NAME_NORM} mkpart primary 8192s 201599s
losetup -o$((8192 * 512)) ${lo} ${OUT_NAME_NORM} losetup -o$((8192 * 512)) ${lo} ${OUT_NAME_NORM}
mkfs.${f} ${lo} mkfs.${f} ${lo}
losetup -d ${lo} losetup -d ${lo}
elif [ $f = ${FS_NTFS} ]; then elif [ $f = ${FS_NTFS} ]; then
mk${f} -f -F ${OUT_NAME} parted -s ${OUT_NAME_NORM} mkpart primary 8192s 201599s
lo=`losetup -f`
losetup -o$((8192 * 512)) ${lo} ${OUT_NAME_NORM}
mk${f} -f -I ${lo}
losetup -d ${lo}
else else
mkfs.${f} -F ${OUT_NAME} parted -s ${OUT_NAME_NORM} mkpart primary 8192s 201599s
lo=`losetup -f`
losetup -o$((8192 * 512)) ${lo} ${OUT_NAME_NORM}
mkfs.${f} ${lo}
losetup -d ${lo}
fi fi
done done

View File

@ -6,6 +6,10 @@ IMAGE='../2014-09-09-wheezy-raspbian.img'
OFFSET_ROOTFS=$((122880 * 512)) OFFSET_ROOTFS=$((122880 * 512))
IMAGE_VFAT_NORM="testcase.vfat" IMAGE_VFAT_NORM="testcase.vfat"
IMAGE_NTFS_NORM="testcase.ntfs"
IMAGE_EXT2="testcase.ext2"
IMAGE_EXT3="testcase.ext3"
IMAGE_EXT4="testcase.ext4"
OFFSET_VFAT_NORM=$((8192 * 512)) OFFSET_VFAT_NORM=$((8192 * 512))
IMAGE_VFAT_PART="testcase.part.vfat" IMAGE_VFAT_PART="testcase.part.vfat"
@ -51,7 +55,36 @@ umount ${SETUP_DIR}
mount -o loop,offset=${OFFSET_VFAT_PART2} ${IMAGE_VFAT_PART} ${SETUP_DIR} mount -o loop,offset=${OFFSET_VFAT_PART2} ${IMAGE_VFAT_PART} ${SETUP_DIR}
cp content_img_vfat_part2/* ${SETUP_DIR} cp content_img_vfat_part2/* ${SETUP_DIR}
umount ${SETUP_DIR} umount ${SETUP_DIR}
# Prepare the test source key (NTFS)
mount -o loop,offset=${OFFSET_VFAT_NORM} ${IMAGE_NTFS_NORM} ${SETUP_DIR}
cp content_img_vfat_norm/* ${SETUP_DIR}
umount ${SETUP_DIR}
# Prepare the test source key (EXT2)
mount -o loop,offset=${OFFSET_VFAT_NORM} ${IMAGE_EXT2} ${SETUP_DIR}
cp content_img_vfat_norm/* ${SETUP_DIR}
umount ${SETUP_DIR}
# Prepare the test source key (EXT3)
mount -o loop,offset=${OFFSET_VFAT_NORM} ${IMAGE_EXT3} ${SETUP_DIR}
cp content_img_vfat_norm/* ${SETUP_DIR}
umount ${SETUP_DIR}
# Prepare the test source key (EXT4)
mount -o loop,offset=${OFFSET_VFAT_NORM} ${IMAGE_EXT4} ${SETUP_DIR}
cp content_img_vfat_norm/* ${SETUP_DIR}
umount ${SETUP_DIR}
./run.exp ${IMAGE} ${IMAGE_VFAT_NORM} ${IMAGE_DEST} ./run.exp ${IMAGE} ${IMAGE_VFAT_NORM} ${IMAGE_DEST}
#./run.exp ${IMAGE} ${IMAGE_VFAT_PART} ${IMAGE_DEST} sleep 10
./run.exp ${IMAGE} ${IMAGE_VFAT_PART} ${IMAGE_DEST}
sleep 10
./run.exp ${IMAGE} ${IMAGE_NTFS_NORM} ${IMAGE_DEST}
# EXT* not supported due to permission issues
#sleep 10
#./run.exp ${IMAGE} ${IMAGE_EXT2} ${IMAGE_DEST}
#sleep 10
#./run.exp ${IMAGE} ${IMAGE_EXT3} ${IMAGE_DEST}
#sleep 10
#./run.exp ${IMAGE} ${IMAGE_EXT4} ${IMAGE_DEST}