OSDN Git Service

tests: remove tests that are too FS-centric
authorJim Meyering <meyering@redhat.com>
Thu, 17 Sep 2009 18:12:50 +0000 (20:12 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 17 May 2011 13:02:52 +0000 (15:02 +0200)
* tests/t2100-mkswap.sh: Likewise.
* tests/t3000-resize-fs.sh: Remove file, now that all FS-ops are gone.
* tests/Makefile.am (TESTS): Remove them here, too.

tests/Makefile.am
tests/t2100-mkswap.sh [deleted file]
tests/t3000-resize-fs.sh [deleted file]

index f5a1562..4ea08f3 100644 (file)
@@ -23,12 +23,10 @@ TESTS = \
   t1100-busy-label.sh \
   t1101-busy-partition.sh \
   t1700-probe-fs.sh \
-  t2100-mkswap.sh \
   t2200-dos-label-recog.sh \
   t2300-dos-label-extended-bootcode.sh \
   t2310-dos-extended-2-sector-min-offset.sh \
   t2400-dos-hfs-partition-type.sh \
-  t3000-resize-fs.sh \
   t3200-type-change.sh \
   t3300-palo-prep.sh \
   t3310-flags.sh \
diff --git a/tests/t2100-mkswap.sh b/tests/t2100-mkswap.sh
deleted file mode 100755 (executable)
index b48a122..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/sh
-# create linux-swap partitions
-
-# Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-. "${srcdir=.}/init.sh"; path_prepend_ ../parted
-require_512_byte_sector_size_
-
-######################################################################
-# When creating a partition of type linux-swap(v1) in a DOS partition
-# table, ensure that the proper file system type (0x82) is used.
-# Some releases, e.g. parted-1.8.8 would mistakenly use 0x83.
-######################################################################
-N=2M
-dev=loop-file
-dev2=loop-file-2
-# create a file to simulate the underlying device
-dd if=/dev/null of=$dev bs=1 seek=$N 2> /dev/null || fail=1
-
-# label the test disk
-parted -s $dev mklabel msdos > out 2>&1 || fail=1
-compare out /dev/null || fail=1
-
-# create a partition
-parted -s $dev mkpart primary 2048s 4095s > out 2>&1 || fail=1
-compare out /dev/null || fail=1
-
-# create a linux-swap file system
-parted -s $dev mkfs 1 "linux-swap(v1)" > out 2>&1 || fail=1
-compare out /dev/null || fail=1
-
-# Extract the byte at offset 451.  It must be 0x82, not 0x83.
-# extract byte 451 (fs-type)
-od -t x1 -An -j450 -N1 $dev > out && echo " 82" > exp || fail=1
-
-# expect it to be 82, not 83
-compare out exp || fail=1
-
-# create another file to simulate the underlying device
-dd if=/dev/null of=$dev2 bs=1 seek=$N 2> /dev/null || fail=1
-
-# label another test disk
-parted -s $dev2 mklabel msdos > out 2>&1 || fail=1
-compare out /dev/null || fail=1
-
-# create another partition
-parted -s $dev2 mkpart primary 2048s 4095s > out 2>&1 || fail=1
-compare out /dev/null || fail=1
-
-# create another linux-swap file system
-parted -s $dev2 mkfs 1 "linux-swap(v1)" > out 2>&1 || fail=1
-compare out /dev/null || fail=1
-
-# partition starts at offset 1048576; swap UUID is 1036 bytes in
-# extract UUID 1
-od -t x1 -An -j1049612 -N16 $dev > uuid1 || fail=1
-# extract UUID 2
-od -t x1 -An -j1049612 -N16 $dev2 > uuid2 || fail=1
-# two linux-swap file systems must have different UUIDs
-cmp uuid1 uuid2 && fail=1
-
-# check linux-swap file system
-parted -s $dev2 check 1 > out 2>&1 || fail=1
-compare out /dev/null || fail=1
-
-# extract new UUID 2
-od -t x1 -An -j1049612 -N16 $dev2 > uuid2-new || fail=1
-# check preserves linux-swap UUID
-compare uuid2 uuid2-new || fail=1
-
-# create a linux-swap file system via alias
-parted -s $dev mkfs 1 linux-swap > out 2>&1 || fail=1
-compare out /dev/null || fail=1
-
-Exit $fail
diff --git a/tests/t3000-resize-fs.sh b/tests/t3000-resize-fs.sh
deleted file mode 100755 (executable)
index caed954..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/sh
-# exercise the resize sub-command; FAT and HFS only
-
-# Copyright (C) 2009-2011 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-. "${srcdir=.}/init.sh"; path_prepend_ ../parted
-require_hfs_
-
-require_root_
-require_scsi_debug_module_
-require_512_byte_sector_size_
-
-ss=$sector_size_
-
-start=63s
-default_end=546147s
-    new_end=530144s
-
-# create memory-backed device
-scsi_debug_setup_ dev_size_mb=550 > dev-name ||
-  skip_ 'failed to create scsi_debug device'
-dev=$(cat dev-name)
-
-parted -s $dev mklabel gpt > out 2>&1 || fail=1
-# expect no output
-compare out /dev/null || fail=1
-
-# ensure that the disk is large enough
-dev_n_sectors=$(parted -s $dev u s p|sed -n '2s/.* \([0-9]*\)s$/\1/p')
-device_sectors_required=$(echo $default_end | sed 's/s$//')
-# Ensure that $dev is large enough for this test
-test $device_sectors_required -le $dev_n_sectors || fail=1
-
-for fs_type in hfs+ fat32; do
-
-  # create an empty $fs_type partition, cylinder aligned, size > 256 MB
-  parted -s $dev mkpart primary $fs_type $start $default_end > out 2>&1 || fail=1
-  echo "Warning: The resulting partition is not properly" \
-      "aligned for best performance." > exp
-  compare out exp || fail=1
-
-  # print partition table
-  parted -m -s $dev u s p > out 2>&1 || fail=1
-
-  # FIXME: check expected output
-
-  # There's a race condition here: on udev-based systems, the partition#1
-  # device, ${dev}1 (i.e., /dev/sde1) is not created immediately, and
-  # without some delay, this mount command would fail.  Using a flash card
-  # as $dev, the loop below typically iterates 7-20 times.
-
-  # wait for new partition device to appear
-  wait_for_dev_to_appear_ ${dev}1 || { warn_ "${dev}1 did not appear"  fail=1; }
-  sleep 1
-
-  case $fs_type in
-    fat32) mkfs_cmd='mkfs.vfat -F 32';;
-    hfs*) mkfs_cmd='mkfs.hfs';;
-    *) error "internal error: unhandled fs type: $fs_type";;
-  esac
-
-  # create the file system
-  $mkfs_cmd ${dev}1 || fail=1
-
-  # NOTE: shrinking is the only type of resizing that works.
-  # resize that file system to be one cylinder (8MiB) smaller
-  parted -s $dev resize 1 $start $new_end > out 2> err || fail=1
-  # expect no output
-  compare out /dev/null || fail=1
-  compare err /dev/null || fail=1
-
-  # print partition table
-  parted -m -s $dev u s p > out 2>&1 || fail=1
-
-  # compare against expected output
-  sed -n 3p out > k && mv k out || fail=1
-  printf "1:$start:$new_end:530082s:$fs_type:primary:$ms;\n" > exp || fail=1
-  compare out exp || fail=1
-
-  # Remove the partition explicitly, so that mklabel doesn't evoke a warning.
-  parted -s $dev rm 1 || fail=1
-
-  # Create a clean partition table for the next iteration.
-  parted -s $dev mklabel gpt > out 2>&1 || fail=1
-  # expect no output
-  compare out /dev/null || fail=1
-
-done
-
-Exit $fail