From d8d4eac278939db6a22fe69181138be2d2dd79e6 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 28 Sep 2011 19:43:40 +0200 Subject: [PATCH 3/4] tests: test for the nilfs2 bug * tests/t4300-nilfs2-tiny.sh: New test. * tests/Makefile.am (TESTS): Add it. --- tests/Makefile.am | 1 + tests/t4300-nilfs2-tiny.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 0 deletions(-) create mode 100755 tests/t4300-nilfs2-tiny.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index 86402c0..e721f88 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -38,6 +38,7 @@ TESTS = \ t4100-dvh-partition-limits.sh \ t4100-msdos-starting-sector.sh \ t4200-partprobe.sh \ + t4300-nilfs2-tiny.sh \ t5000-tags.sh \ t6000-dm.sh \ t7000-scripting.sh \ diff --git a/tests/t4300-nilfs2-tiny.sh b/tests/t4300-nilfs2-tiny.sh new file mode 100755 index 0000000..009a3cd --- /dev/null +++ b/tests/t4300-nilfs2-tiny.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# Trigger a nilfs2-related bug. + +# Copyright (C) 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 . + +. "${srcdir=.}/init.sh"; path_prepend_ ../parted +ss=$sector_size_ + +n_sectors=200 +dev=dev-file +dd if=/dev/null of=$dev bs=$ss seek=$n_sectors || framework_failure_ + +# Create a tiny, 7-sector partition. +parted -s $dev mklabel gpt mkpart p1 64s 70s || framework_failure_ + +# This used to make parted abort. +parted -s $dev u s p || fail=1 + +Exit $fail -- 1.7.6.4