[PATCH 2/3] Add a test for the reqpart command.

Chris Lumens clumens at redhat.com
Thu Sep 3 20:23:56 UTC 2015


...which appears to be busted, so I guess the next thing to do is fix
it.
---
 tests/kickstart_tests/reqpart.ks | 41 ++++++++++++++++++++++++++++++++++++++++
 tests/kickstart_tests/reqpart.sh | 22 +++++++++++++++++++++
 2 files changed, 63 insertions(+)
 create mode 100644 tests/kickstart_tests/reqpart.ks
 create mode 100755 tests/kickstart_tests/reqpart.sh

diff --git a/tests/kickstart_tests/reqpart.ks b/tests/kickstart_tests/reqpart.ks
new file mode 100644
index 0000000..cacefa9
--- /dev/null
+++ b/tests/kickstart_tests/reqpart.ks
@@ -0,0 +1,41 @@
+#version=DEVEL
+url --mirror=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-rawhide&arch=$basearch
+install
+network --bootproto=dhcp
+
+bootloader --timeout=1
+zerombr
+clearpart --all --initlabel
+
+reqpart
+part pv.1 --fstype=lvmpv --size=4504
+volgroup fedora pv.1
+logvol swap --name=swap --vgname=fedora --size=500 --fstype=swap
+logvol / --name=root --vgname=fedora --size=4000 --label=root
+
+keyboard us
+lang en_US.UTF-8
+timezone America/New_York --utc
+rootpw testcase
+shutdown
+
+%packages
+%end
+
+%post
+# FIXME: This will need to test for other things one day when we support tests on other arches
+boot_mount="$(grep /mnt/sysimage/boot /proc/mounts)"
+if [ -z "${boot_mount}" ]; then
+    echo "*** no /boot mount point was created by reqpart" >> /root/RESULT
+fi
+
+# Also verify the partitions we explicitly asked for got made.
+root_fstype=$(blkid -o value -t LABEL=root -s TYPE)
+if [ "${root_fstype}" != "ext4" ]; then
+    echo "default fstype is incorrect (got $root_fstype; expected ext4)" >> /root/RESULT
+fi
+
+if [ ! -e /root/RESULT ]; then
+    echo SUCCESS > /root/RESULT
+fi
+%end
diff --git a/tests/kickstart_tests/reqpart.sh b/tests/kickstart_tests/reqpart.sh
new file mode 100755
index 0000000..4ab581a
--- /dev/null
+++ b/tests/kickstart_tests/reqpart.sh
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2015  Red Hat, Inc.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions of
+# the GNU General Public License v.2, or (at your option) any later version.
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY expressed or implied, including the implied warranties 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, write to the
+# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.  Any Red Hat trademarks that are incorporated in the
+# source code or documentation are not subject to the GNU General Public
+# License and may only be used or replicated with the express permission of
+# Red Hat, Inc.
+#
+# Red Hat Author(s): Chris Lumens <clumens at redhat.com>
+
+TESTTYPE="storage"
+
+. ${KSTESTDIR}/functions.sh
-- 
2.4.3



More information about the anaconda-patches mailing list