From 06c9252384909afde8b66a2bbeaecc9b041a4fd0 Mon Sep 17 00:00:00 2001 From: Christoph Galuschka Date: Nov 09 2013 19:30:07 +0000 Subject: added t_log to the beginning of the scripts where missing --- diff --git a/tests/p_shadow-utils/11-useradd_tests b/tests/p_shadow-utils/11-useradd_tests index 960cc2d..12206c6 100755 --- a/tests/p_shadow-utils/11-useradd_tests +++ b/tests/p_shadow-utils/11-useradd_tests @@ -1,7 +1,7 @@ #!/bin/bash # Author: Iain Douglas -echo "Running $0" +t_Log "Running $0" # Basic useradd tests echo "Add user shadowuser" diff --git a/tests/p_shadow-utils/12-usermod_tests b/tests/p_shadow-utils/12-usermod_tests index a11025f..49c6279 100755 --- a/tests/p_shadow-utils/12-usermod_tests +++ b/tests/p_shadow-utils/12-usermod_tests @@ -1,8 +1,7 @@ #!/bin/bash # Author: Iain Douglas -echo "Running $0" -echo "Modify user shadowuser" +t_Log "Running $0 - Modify user shadowuser" usermod -c "Comment plugh" shadowuser t_CheckExitStatus $? echo "Check /etc/passwd was modified" diff --git a/tests/p_shadow-utils/13-chpasswd_tests b/tests/p_shadow-utils/13-chpasswd_tests index c7825fc..cb47fc5 100755 --- a/tests/p_shadow-utils/13-chpasswd_tests +++ b/tests/p_shadow-utils/13-chpasswd_tests @@ -1,8 +1,7 @@ #!/bin/bash # Author: Iain Douglas -echo "Running $0" -echo "Checking chpasswd" +t_Log "Running $0 - Checking chpasswd" chpasswd -e < -echo "Running $0" -echo "Testing newusers" +t_Log "Running $0 - Testing newusers" grep -q "^xyssy" /etc/passwd && { t_Log "FAIL: user xyssy alredy exists"; exit $FAIL; } newusers < -echo "Running $0" -echo "Checking lastlog" +t_Log "Running $0 - Checking lastlog" lastlog -u shadowuser | grep -q '**Never logged in**' t_CheckExitStatus $? diff --git a/tests/p_shadow-utils/19-userdel_tests b/tests/p_shadow-utils/19-userdel_tests index 946d631..096d68c 100755 --- a/tests/p_shadow-utils/19-userdel_tests +++ b/tests/p_shadow-utils/19-userdel_tests @@ -1,8 +1,7 @@ #!/bin/bash # Author: Iain Douglas -echo "Running $0" -echo "Delete user shadowuser" +t_Log "Running $0 - Delete user shadowuser" userdel -r shadowuser t_CheckExitStatus $? echo "Check user was deleted" diff --git a/tests/p_shadow-utils/20-chage_tests b/tests/p_shadow-utils/20-chage_tests index 57cb630..5f85c97 100755 --- a/tests/p_shadow-utils/20-chage_tests +++ b/tests/p_shadow-utils/20-chage_tests @@ -1,7 +1,7 @@ #!/bin/bash # Author: Iain Douglas -echo "Running $0" +t_Log "Running $0" userdel -rf testshadow; useradd testshadow echo "testshadow" | passwd --stdin testshadow diff --git a/tests/p_shadow-utils/30-groupadd_tests b/tests/p_shadow-utils/30-groupadd_tests index 40dce6c..79f4617 100755 --- a/tests/p_shadow-utils/30-groupadd_tests +++ b/tests/p_shadow-utils/30-groupadd_tests @@ -1,6 +1,6 @@ #!/bin/bash # Author: Iain Douglas -echo "Running $0 group add tests" +t_Log "Running $0 group add tests" # Delete any info from previous runs, use sed because we haven't yet tested # groupdel diff --git a/tests/p_shadow-utils/31-gpasswd_tests b/tests/p_shadow-utils/31-gpasswd_tests index 086a2d9..179d61c 100755 --- a/tests/p_shadow-utils/31-gpasswd_tests +++ b/tests/p_shadow-utils/31-gpasswd_tests @@ -1,6 +1,6 @@ #!/bin/bash # Author: Iain Douglas -echo "Running $0 gpasswd tests" +t_Log "Running $0 - gpasswd tests" echo "Add a user to testgroup and create /etc/gshadow" gpasswd -a testshadow testgroup diff --git a/tests/p_shadow-utils/32-groupmems_tests b/tests/p_shadow-utils/32-groupmems_tests index a99c52c..7e3cc90 100755 --- a/tests/p_shadow-utils/32-groupmems_tests +++ b/tests/p_shadow-utils/32-groupmems_tests @@ -1,7 +1,7 @@ #!/bin/bash # Author: Iain Douglas [ $centos_ver == '5' ] && exit -echo "Running $0 group add tests" +t_Log "Running $0 - group add tests" echo "Simple groupmems test" groupmems -g testgroup -l | grep -q "testshadow" diff --git a/tests/p_shadow-utils/33-newgrp_tests b/tests/p_shadow-utils/33-newgrp_tests index c73633a..41c1da2 100755 --- a/tests/p_shadow-utils/33-newgrp_tests +++ b/tests/p_shadow-utils/33-newgrp_tests @@ -4,7 +4,7 @@ # Check that the user can change their primary group. This relies on the # observation that the current primary group is printed first # -echo "Basic newgrp test" +t_Log "Running $0 - Basic newgrp test" groups testshadow | grep -q "testshadow testgroup" || { t_Log "FAIL: Default testshadow user group information incorrect"; exit $FAIL; } echo OK echo $( su - testshadow < -echo "Running $0" +t_Log "Running $0" # Check that the testgroup exists with GID 1010 grep -q "testgroup:x:1010:testshadow" /etc/group || { t_Log "FAIL Test group doesn't exist"; exit $FAIL; } diff --git a/tests/p_shadow-utils/35-grpck-tests b/tests/p_shadow-utils/35-grpck-tests index 3dee694..e48b68d 100755 --- a/tests/p_shadow-utils/35-grpck-tests +++ b/tests/p_shadow-utils/35-grpck-tests @@ -1,7 +1,7 @@ #!/bin/bash # Author: Iain Douglas -echo "Running $0" +t_Log "Running $0" # If we're on C5 delete the group 990991 which was added by newusers if (( $centos_ver == 5 )) diff --git a/tests/p_shadow-utils/36-groupdel-tests b/tests/p_shadow-utils/36-groupdel-tests index 0e1e21b..8677902 100755 --- a/tests/p_shadow-utils/36-groupdel-tests +++ b/tests/p_shadow-utils/36-groupdel-tests @@ -1,7 +1,7 @@ #!/bin/bash # Author: Iain Douglas -echo "Running $0" +t_Log "Running $0" # Check that we can delete the testgroup echo "Check we can delete the group 'testgroup'" diff --git a/tests/p_shadow-utils/37-grpconv-tests b/tests/p_shadow-utils/37-grpconv-tests index 5900530..52dfa81 100755 --- a/tests/p_shadow-utils/37-grpconv-tests +++ b/tests/p_shadow-utils/37-grpconv-tests @@ -1,6 +1,7 @@ #!/bin/bash # Author: Iain Douglas +t_Log "Running $0" # Test grpconv cleanup() { echo "Reverting files to original state" diff --git a/tests/p_shadow-utils/38-grpunconv-tests b/tests/p_shadow-utils/38-grpunconv-tests index 6165f41..76eec52 100755 --- a/tests/p_shadow-utils/38-grpunconv-tests +++ b/tests/p_shadow-utils/38-grpunconv-tests @@ -1,7 +1,7 @@ #!/bin/bash # Author: Iain Douglas -echo "Running $0" +t_Log "Running $0" cleanup() { echo "Reverting files to original state" [[ -d /var/tmp/grpunconv ]] && cp /var/tmp/grpunconv/* /etc && rm -r /var/tmp/grpunconv diff --git a/tests/p_shadow-utils/39-sg_tests b/tests/p_shadow-utils/39-sg_tests index f747b50..c25b873 100755 --- a/tests/p_shadow-utils/39-sg_tests +++ b/tests/p_shadow-utils/39-sg_tests @@ -1,7 +1,6 @@ #!/bin/bash # Author: Iain Douglas -echo "Running $0" -echo "Testing sg" +t_Log "Running $0 - Testing sg" sg testshadow "touch /var/tmp/sg" t_CheckExitStatus $? echo "Check sg worked" diff --git a/tests/p_shadow-utils/40-pwck_tests b/tests/p_shadow-utils/40-pwck_tests index 8c9af95..ac27fe3 100755 --- a/tests/p_shadow-utils/40-pwck_tests +++ b/tests/p_shadow-utils/40-pwck_tests @@ -5,7 +5,7 @@ # (e.g. adm) aren't created correctly so all we can really test is dummy # files. -echo "Running $0" +t_Log "Running $0" echo "Check pwck passes correctly formed files" echo "test:x:500:500::/tmp:/bin/bash" >/var/tmp/passwd diff --git a/tests/p_shadow-utils/41-pwconv_tests b/tests/p_shadow-utils/41-pwconv_tests index 5785c44..5b8b4eb 100755 --- a/tests/p_shadow-utils/41-pwconv_tests +++ b/tests/p_shadow-utils/41-pwconv_tests @@ -1,7 +1,7 @@ #!/bin/bash # Author: Iain Douglas -echo "Running $0" +t_Log "Running $0" echo "*****************************************************************" echo "Note: The original /etc/passwd and /etc/shadow files are saved to" echo "directory /var/tmp/pwconv". diff --git a/tests/p_shadow-utils/42-pwunconv_tests b/tests/p_shadow-utils/42-pwunconv_tests index dbded82..6c00213 100755 --- a/tests/p_shadow-utils/42-pwunconv_tests +++ b/tests/p_shadow-utils/42-pwunconv_tests @@ -1,7 +1,7 @@ #!/bin/bash # Author: Iain Douglas -echo "Running $0" +t_Log "Running $0" echo "*****************************************************************" echo "Note: The original /etc/passwd and /etc/shadow files are saved to" echo "directory /var/tmp/pwunconv".