Kickstart scripts for adding specified user during installation as well as check-up if the user was successfully added to the system, including password, /home/<user> directory and specified group.
Signed-off-by: Karel Valek kvalek@redhat.com
Fixed: Removed "FAILED:", removed unneeded comments.
Looks good to me
Added label: ACK.
Looks good to me too. Feel free to push.
@@ -0,0 +1,80 @@ +url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/$releasever/$basear..."
+install
+network --bootproto=dhcp
+bootloader --timeout=1 +zerombr
+clearpart --all +autopart --type=lvm
+keyboard us +lang en +timezone America/New_York
+rootpw qweqwe
+## TEST CREATE USER +# Create specific user group +group --name=kosygroup --gid=5001
+# Create specific user +user --name=kosieh --gecos="Kosieh Barter" --homedir=/home/kbarter --password="$6$QsJCB9E6geIjWNvn$UZLEtnHYgKmFgrPo0fY1qNBc/aRi9b01f19w9mpdFm9.MPblckUuFYvpRLSzeYeR/6lO/2uY4WtjhbryC0k2L/" --iscrypted --shell=/bin/bash --uid=4001 --gid=5001
+shutdown
+%packages +%end
+%post
+## TEST CREATE USER CHECK +# Check group +cat /etc/group | grep 5001
May as well check for the group name too
@@ -0,0 +1,80 @@ +url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/$releasever/$basear..."
+install
+network --bootproto=dhcp
+bootloader --timeout=1 +zerombr
+clearpart --all +autopart --type=lvm
+keyboard us +lang en +timezone America/New_York
+rootpw qweqwe
+## TEST CREATE USER +# Create specific user group +group --name=kosygroup --gid=5001
+# Create specific user +user --name=kosieh --gecos="Kosieh Barter" --homedir=/home/kbarter --password="$6$QsJCB9E6geIjWNvn$UZLEtnHYgKmFgrPo0fY1qNBc/aRi9b01f19w9mpdFm9.MPblckUuFYvpRLSzeYeR/6lO/2uY4WtjhbryC0k2L/" --iscrypted --shell=/bin/bash --uid=4001 --gid=5001
+shutdown
+%packages +%end
+%post
+## TEST CREATE USER CHECK +# Check group +cat /etc/group | grep 5001 +if [[ $? -ne 0 ]]; then
- echo "Group failed to create." >> /root/RESULT
+fi
+# Check find username +cat /etc/passwd | grep kosieh +if [[ $? -ne 0 ]]; then
- echo "User is not present in system." >> /root/RESULT
+fi
+# Check GEDOS: real name +cat /etc/passwd | grep kosieh | grep "Kosieh Barter" +if [[ $? -ne 0 ]]; then
- echo "User is present, but not all details: REAL NAME (GEDOS)" >> /root/RESULT
+fi
+# Check if the user has his/her bash +cat /etc/passwd | grep kosieh | grep "/bin/bash" +if [[ $? -ne 0 ]]; then
- echo "User is present, but /bin/bash is not set" >> /root/RESULT
+fi
Add a check to make sure the home directory is in /etc/passwd too.
@@ -0,0 +1,80 @@ +url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/$releasever/$basear..."
+install
+network --bootproto=dhcp
+bootloader --timeout=1 +zerombr
+clearpart --all +autopart --type=lvm
This should just be autopart since we're not testing autopart type (and to be consistent with the other kickstarts)
Edited locally, added test for /etc/passwd home dir + group name. Pushed.
Closed.
anaconda-patches@lists.fedorahosted.org