Updated buildscripts (v2.2.8)

Erik-Jan ej.lfs at xs4all.nl
Sun Apr 20 05:04:45 PDT 2003


Bill's LFS Login wrote:
> 
> Hola Ryan!
> 
> I've got the bit in my teeth here, so "perfection is acceptable". :)

Hi Bill,

I've been working on the coreutils make check as well, but the
fail-2eperm-test only gives me problems in coreutils versions up to
4.5.9. In 4.5.10, the fail-2eperm-test has been changed and it works ok
for me now. 
(small quick-fix for 4.5.9: edit tests/rm/fail-2eperm, find the line
starting with "su -c" and change that to "su --shell=/bin/sh -c"  It now
definately uses a valid shell)

The sed you send suggests there is something wrong with PATH, while
doing the tests. Can you do this for me to make sure?
untar a fresh coreutils and cd into it
do the usual ./configure --prefix=/stage1 && make LDFLAGS="-s"
enter the src-dir. Now we can do the test manually:
mkdir a
chmod 1777 a
touch a/b
su --shell=/bin/sh -c 'rm -rf a' username
 ** username is any user on your system, different from the (root?)user
that did the configure and make. So on your system it will be ehhh bill?
:))
This should give you the output you got, with the "unlink" and
"Directory not empty"-things

Now try:
su --shell=/bin/sh -c './rm -rf a' username
It now uses the newly built rm, and it should give the expected "./rm:
cannot remove `a/b': Operation not permitted". This is the way the full
fail-2eperm-test should work.
Does your system do this as well? 


I've attached a patch that I've used to test with coreutils-4.5.9,
4.5.10, 4.5.12 and 5.0, and fileutils 4.1 and 4.11, and all tests went
OK. I've used the CANDIDATE_TMP_DIR-thing as well, only I exported it in
the build-init-script; makes it easier to change when building on
another pc.
What does it all do:
- assigns a valid shell to the fail-2eperm-test in coreutils-versions <
4.5.10
- the user-test in Ryan's script assume a user 'nobody', with a valid
shell. This could give a problem. I've added a user plfstest and two
testgroups, to make sure everything is ok. The useradd-command gives the
new user a valid shell. -M prevents creating a  home-directory, because
it isn't needed. 
- it sets the permissions on the test-suite to the testuser. 

HTH,

Bye,
Erik-Jan
-------------- next part --------------
--- build-ch5-2.2.8.sh.orig	Sun Apr 20 13:39:05 2003
+++ build-ch5-2.2.8.sh	Sun Apr 20 13:43:39 2003
@@ -1020,6 +1020,18 @@
       >> ${LOGFILE} 2>&1 &&
 echo " o ALL OK" || echo "XXXXXX NOT OK - CHECK LOGS (${LOGFILE}) XXXXXX"
 
+### COREUTILS/FILEUTILS ###
+
+# Will be running user tests as "plfstest"
+# For chgrp tests the user needs to be in more than one group.
+# We will temporarily add the groups "plfstest" and "plfstest2"
+# and add user "plfstest" to them. Used by both coreutils and fileutils.
+grep ^plfstest: /etc/passwd > /dev/null 2>&1 || 
+	useradd -M -s /bin/sh plfstest &&
+grep ^plfstest: /etc/group > /dev/null 2>&1 || groupadd plfstest &&
+grep ^plfstest2: /etc/group > /dev/null 2>&1 || groupadd plfstest2 &&
+usermod -G plfstest,plfstest2 plfstest &&
+
 # If we are using coreutils, dont install fileutils
 test Y = "${USE_COREUTILS}" &&
 {
@@ -1029,6 +1041,15 @@
    unpack_tarball coreutils-${COREUTILS_VER}
    cd ${PKGDIR}
 
+   # make sure to use a valid shell in tests/rm/fail-2eperm.
+   # only needed in versions <= 4.5.9
+   TESTFILE=tests/rm/fail-2eperm
+   grep 'valid shell' ${TESTFILE} > /dev/null 2>&1 || {
+      cp ${TESTFILE}{,.bak}
+      sed 's%su -c%su --shell=/bin/sh -c%' ${TESTFILE}.bak > ${TESTFILE}
+      rm ${TESTFILE}.bak
+   }
+
    max_log_init Coreutils initial "(shared)" ${CONFLOGS} ${LOG}
    CFLAGS="-O2 -pipe" ./configure --prefix=/stage1  \
       >> ${LOGFILE} 2>&1 &&
@@ -1044,21 +1065,16 @@
    make check-root \
       >>  ${LOGFILE} 2>&1 &&
    echo " o Root Tests OK" &&
+   echo -e "\n${BRKLN}" >> ${LOGFILE} &&
 
-   # Will be running user tests as "nobody"
-   # For chgrp tests the user needs to be in more than one group.
-   # we will temporarily add the group "plfstest" and add nobody to it
-   groupadd plfstest &&
-   usermod -G plfstest nobody &&
+   # set permissions  
+   chown -R plfstest:plfstest tests &&
 
    echo -e "\n User Tests \n------------" >> ${LOGFILE} &&
-   su nobody -c "env RUN_EXPENSIVE_TESTS=yes make check" \
+   su plfstest -c "env RUN_EXPENSIVE_TESTS=yes make check" \
       >>  ${LOGFILE} 2>&1 &&
    echo " o User Tests OK" || echo "XXXXXX NOT OK - CHECK LOGS (${LOGFILE}) XXXXXX"
 
-   # Remove plfstest group
-   groupdel plfstest 
-
    min_log_init ${INSTLOGS} &&
    make install \
       >> ${LOGFILE} 2>&1 &&
@@ -1082,16 +1098,33 @@
    echo " o Build OK" &&
 
    min_log_init ${TESTLOGS} &&
-   make check \
+   echo -e "\n Root Tests \n------------" >> ${LOGFILE} &&
+   make check-root \
+      >>  ${LOGFILE} 2>&1 &&
+   echo " o Root Tests OK" &&
+   echo -e "\n${BRKLN}" >> ${LOGFILE} &&
+
+   # set permissions
+   chown -R plfstest:plfstest tests &&
+
+   echo -e "\n User Tests \n------------" >> ${LOGFILE} &&
+   su plfstest -c "env RUN_EXPENSIVE_TESTS=yes make check" \
       >>  ${LOGFILE} 2>&1 &&
-   echo " o Test OK" &&
+   echo " o User Tests OK" || echo "XXXXXX NOT OK - CHECK LOGS (${LOGFILE}) XXXXXX"
 
    min_log_init ${INSTLOGS} &&
+echo "Make install ${PKGDIR}" 
+      >> ${LOGFILE} 2>&1 &&
    make install \
       >> ${LOGFILE} 2>&1 &&
    echo " o ALL OK" || echo "XXXXXX NOT OK - CHECK LOGS (${LOGFILE}) XXXXXX"
 }
 
+# Remove plfstest user and groups 
+grep ^plfstest: /etc/passwd > /dev/null 2>&1 && userdel plfstest
+grep ^plfstest: /etc/group > /dev/null 2>&1 && groupdel plfstest
+grep ^plfstest2: /etc/group > /dev/null 2>&1 && groupdel plfstest2
+
 ### BZIP2 ###
 # export BZIP2_VER=1.0.2
 cd ${SRC}


More information about the lfs-dev mailing list