From: "Brian C. Lane" <bcl(a)redhat.com>
Setup different UID/GIDs for polipo and lighttpd to test writing
/etc/passwd before package installation.
---
tests/kickstart_tests/pre-install.ks | 64 ++++++++++++++++++++++++++++++++++++
tests/kickstart_tests/pre-install.sh | 20 +++++++++++
2 files changed, 84 insertions(+)
create mode 100644 tests/kickstart_tests/pre-install.ks
create mode 100755 tests/kickstart_tests/pre-install.sh
diff --git a/tests/kickstart_tests/pre-install.ks b/tests/kickstart_tests/pre-install.ks
new file mode 100644
index 0000000..241cfad
--- /dev/null
+++ b/tests/kickstart_tests/pre-install.ks
@@ -0,0 +1,64 @@
+url
--url="http://dl.fedoraproject.org/pub/fedora/linux/development/$releasever/$basearch/os/"
+
+install
+
+network --bootproto=dhcp
+
+bootloader --timeout=1
+zerombr
+
+clearpart --all --initlabel
+autopart
+
+keyboard us
+lang en
+timezone America/New_York
+
+rootpw qweqwe
+
+shutdown
+
+%pre-install
+# TEST setting up /etc/passwd before package installation
+mkdir $ANA_INSTALL_PATH/etc
+cat > $ANA_INSTALL_PATH/etc/passwd << EOF
+root:x:0:0:root:/root:/bin/bash
+bin:x:1:1:bin:/bin:/sbin/nologin
+daemon:x:2:2:daemon:/sbin:/sbin/nologin
+adm:x:3:4:adm:/var/adm:/sbin/nologin
+lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
+sync:x:5:0:sync:/sbin:/bin/sync
+shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
+halt:x:7:0:halt:/sbin:/sbin/halt
+mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
+operator:x:11:0:operator:/root:/sbin/nologin
+games:x:12:100:games:/usr/games:/sbin/nologin
+ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
+nobody:x:99:99:Nobody:/:/sbin/nologin
+polipo:x:600:600:Polipo Web Proxy:/var/cache/polipo:/sbin/nologin
+lighttpd:x:601:601:lighttpd web server:/var/www/lighttpd:/sbin/nologin
+EOF
+%end
+
+%packages
+polipo
+lighttpd
+%end
+
+%post
+## TEST pre-install
+cat /etc/passwd | grep "polipo:x:600:600"
+if [[ $? -ne 0 ]]; then
+ echo "*** pre-install failed, wrong polipo entry ***" >>
/root/RESULT
+fi
+
+cat /etc/passwd | grep "lighttpd:x:601:601"
+if [[ $? -ne 0 ]]; then
+ echo "*** pre-install failed, wrong lighttpd entry ***" >>
/root/RESULT
+fi
+
+# Final check
+if [[ ! -e /root/RESULT ]]; then
+ echo SUCCESS > /root/RESULT
+fi
+%end
diff --git a/tests/kickstart_tests/pre-install.sh b/tests/kickstart_tests/pre-install.sh
new file mode 100755
index 0000000..7b2f4f0
--- /dev/null
+++ b/tests/kickstart_tests/pre-install.sh
@@ -0,0 +1,20 @@
+#
+# 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(a)redhat.com>
+
+. ${KSTESTDIR}/functions.sh
--
To view this commit on github, visit
https://github.com/rhinstaller/anaconda/commit/998a0f1611cf445ac367836426...