[PATCH] Add a test for all that container minimization stuff.

Chris Lumens clumens at redhat.com
Tue Nov 10 21:10:47 UTC 2015


---
 tests/kickstart_tests/container.ks.in | 51 +++++++++++++++++++++++++++++++++++
 tests/kickstart_tests/container.sh    | 22 +++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 tests/kickstart_tests/container.ks.in
 create mode 100755 tests/kickstart_tests/container.sh

diff --git a/tests/kickstart_tests/container.ks.in b/tests/kickstart_tests/container.ks.in
new file mode 100644
index 0000000..bd1ca29
--- /dev/null
+++ b/tests/kickstart_tests/container.ks.in
@@ -0,0 +1,51 @@
+#version=DEVEL
+url @KSTEST_URL@
+install
+network --bootproto=dhcp
+
+bootloader --disabled
+zerombr
+clearpart --all --initlabel
+autopart
+
+keyboard us
+lang en_US.UTF-8
+timezone America/New_York --utc
+rootpw testcase
+shutdown
+
+%packages --nocore
+-kernel
+bash
+%end
+
+%post
+rpm -qa | sort > /root/PACKAGES
+
+# (1) No kernel should be installed.
+rpm -q kernel
+if [[ $? == 0 ]]; then
+    echo '*** No kernel package should have been installed' > /root/RESULT
+    exit 1
+fi
+
+# (2) No bootloader package should be installed.
+count=$(rpm -qa grub2\* | wc -l)
+if [[ $count -gt 0 ]]; then
+    echo '*** No bootloader package should have been installed' > /root/RESULT
+    exit 1
+fi
+
+# (3) Not too much other stuff should be installed - the packages we asked for,
+# whatever are dependencies of it, and whatever anaconda decided is needed for
+# our storage config.
+count=$(rpm -qa \* | wc -l)
+if [[ $count -gt 200 ]]; then
+    echo '*** Too much stuff was installed' > /root/RESULT
+    exit 1
+fi
+
+if [ ! -e /root/RESULT ]; then
+    echo SUCCESS > /root/RESULT
+fi
+%end
diff --git a/tests/kickstart_tests/container.sh b/tests/kickstart_tests/container.sh
new file mode 100755
index 0000000..ec90854
--- /dev/null
+++ b/tests/kickstart_tests/container.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="bootloader packaging"
+
+. ${KSTESTDIR}/functions.sh
-- 
2.4.3



More information about the anaconda-patches mailing list