Skip to main content.

Introduction

For the purpose of these instructions, we assume that the ELDK distribution used to build the tests is located at /opt/tmp/eldk-tst, the target filesystem used for testing (mounted as NFS root on the targst) is at /opt/tmp/eldk-tst/ppc_8xx, and the tests are run on a ppc_8xx target system. The ELDK testsuite is based on the test scripts provided by the "crosstool" package.

The testsuite uses the "crosstool" build area under the /opt/tmp/eldk-tst/usr/src/denx/BUILD/crosstool-0.35 directory and the crosstool libraries and binaries that have been installed by the build process under the /opt/tmp/eldk-tst/var/tmp directory.

If you set-up is different in the above aspects, you will need to make obvious adjustments to the commands shown below.

It should be noted that ELDK distribution mentioned above may be any PowerPC ELDK version: to build the testsuite, only the rpmbuild utility from the ELDK distribution is used, and tests running on the target do not require any of the target-based libraries and binaries. The entire testuite filesystem is created by the test scripts at run-time in the home directory of a special "test" user. During the testing, this created at run-time filesystem becomes the "root" directory for all the tests running on the target (i.e. the test suite "changes root" to that newly created filesystem).

Prerequisites to Run the Test Suite

  1. Make necessary preparations on the host.

    Set the TCP protocol management option "tcp_tw_recycle" to 1:
    bash$ echo 1>/proc/sys/net/ipv4/tcp_tw_recycle
    
    That adjustment is required to allow for many short-living RSH connections to be established in a limited period of time, as it is done by the test script.

    Set up the testing area on the target filesystem, as shown below (in particular, you need to add the "test" user and setup the "/home/test" directory):
    bash$ cd /opt/tmp/eldk-tst/ppc_8xx
    bash$ mkdir -p home/test/jail/etc
    bash$ cp etc/passwd home/test/jail/etc
    bash$ echo "test::1000:1000:Test user:/home/test/jail:/sbin/chrootshell" >> etc/passwd
    bash$ echo "test:x:1000:" >> etc/group
    bash$ su
    bash$ chown 1000:1000 home/test
    
  2. Set up an unprotected rsh access to the target.

    To enable "rsh" and "rlogin" access to the target, edit the /etc/xinetd.d/rsh and /etc/xinetd.d/rlogin files on the target filesystem and change the record "disable = yes" to "disable = no" . Also, add the following record to /etc/xinetd.d/rsh :
    "cps = 200 5"
    
    To disable the password protection for the "rsh" and "rlogin" access to the target, execute the following commands while in the root directory on the target filesystem, replacing the <userid> with the actual name of the user who will be starting the test scripts on the host:
    bash$ cd /opt/tmp/eldk-tst/ppc_8xx
    bash$ echo rsh >> etc/securetty
    bash$ echo /sbin/chrootshell >> etc/shells
    bash$ su
    bash$ echo "192.168.1.3 <userid>" > root/.rhosts
    bash$ echo "192.168.1.3 <userid>" > home/test/.rhosts
    bash$ echo "192.168.1.3 <userid>" > etc/hosts.equiv
    bash$ chmod 644 root/.rhosts home/test/.rhosts etc/hosts.equiv
    bash$ chown 1000:1000 home/test/.rhosts
    bash$ chown 0:0 root/.rhosts etc/hosts.equiv
    
    Verify that the the rsh access works from the host to the target for the "root" and "test" users (boot up the target before executing these commands):
    bash$ rsh -l root 192.168.120.2 ls -l /
    connect to address 192.168.120.2 port 544: Connection refused
    Trying krb4 rsh...
    connect to address 192.168.120.2 port 544: Connection refused
    trying normal rsh (/usr/bin/rsh)
    total 52
    drwxr-xr-x   2  512 users 4096 Nov 25  2005 bin
    drwxr-xr-x   2  512 users 4096 Dec  1  2005 dev
    drwxr-xr-x  23  512 users 4096 Dec  1  2005 etc
    drwxr-xr-x   3  512 users 4096 Dec  1  2005 home
    drwxr-xr-x   2  512 users 4096 Nov 25  2005 images
    drwxr-xr-x   6  512 users 4096 Nov 25  2005 lib
    drwxr-xr-x   2  512 users 4096 Nov 25  2005 mnt
    dr-xr-xr-x  27 root root     0 Jan  1  1970 proc
    drwxr-xr-x   2  512 users 4096 Dec  1  2005 root
    drwxr-xr-x   2  512 users 4096 Dec  1  2005 sbin
    drwxrwxrwt   3  512 users 4096 Dec  1  2005 tmp
    drwxr-xr-x  13  512 users 4096 Nov 25  2005 usr
    drwxr-xr-x  12  512 users 4096 Nov 25  2005 var
    drwxr-xr-x   3  512 users 4096 Nov 25  2005 work
    
    bash$ rsh -l test 192.168.120.2 ls -l /
    connect to address 192.168.120.2 port 544: Connection refused
    connect to address 192.168.120.2 port 544: Connection refused
    trying normal rsh (/usr/bin/rsh)
    chrootshell: chroot(/home/test/jail) fails
    
    (The above error message is OK - the actual "root" test filesystem will be created during the execution of the testing script.)

Building and Running the Tests

  1. Install the "crosstool" target Source RPM on the build host and build it:
    1. Set up the necessary environment variables:
      bash$ export CROSS_COMPILE=ppc_8xx-
      bash$ cd /opt/tmp/eldk-tst
      bash$ export PATH=`pwd`/bin:`pwd`/usr/bin:$PATH
      
    2. Change into the "SPECS" directory:
      bash$ cd /opt/tmp/eldk-tst/usr/src/denx/SPECS
      
    3. Install Source RPM and start RPM build:
      bash$ rpm -i <path>/crosstool-0.35-1.src.rpm
      bash$ rpmbuild -bc crosstool.spec
      
      The result of the above commands will be the build area of GCC and glibc, and the toolchain and the libraries installed under "/opt/tmp/eldk-tst/var/tmp/crosstool-0.35-root". This build area will be used for building the test applications.
  2. After the crosstool build is complete, change directory to the "crosstool" build area and install the "chrootshell" auxiliary program, which was created during the building of the "crosstool" package, to the target filesystem:
    bash$ cd ../BUILD/crosstool-0.35
    bash$ su
    bash$ install -m 4755 -o root chrootshell /opt/tmp/eldk-tst/ppc_8xx/sbin
    
  3. If you want to disable particular tests, edit the "runtests.sh" script adjusting variables that enable or disable the tests. By default, all the tests are enabled:
    GCC_TEST
    Set to 1 to enable the GCC/G++ testsuite; remove the variable to disable.
    GLIBC_LINUXTHREADS_TEST
    Set to 1 to enable the testing of the Glibc version with the Linuxthreads package enabled. Remove the variable to disable the testing.
    GLIBC_NPTL_TEST
    Set to 1 to enable the testing of the Glibc version with the NPTL package enabled. Remove the variable to disable the testing.
    BINUTILS_TEST
    Set to 1 to enable the Binutils package testing; remove the variable to disable.
  4. Edit the "runtests.sh" script and set the REMOTE variable to the name or IP address of the test machine.
  5. Start the tests:
    bash$ pwd
    /opt/tmp/eldk-tst/usr/src/denx/BUILD/crosstool-0.35
    bash$ ./runtests.sh 
    
    The "runtests.sh" script will set up the necessary variables and run the main "crosstest.sh" script, which is a part of the "crosstool" source RPM. The "crosstool.sh" script, in its turn, will prepare the test environment on the target filesystem ("chroot jail"), build the tests, transfer them to the target using the "rsh" command, and run them remotely.

    The results of the tests will be available in the current directory:
    bash$ pwd
    /opt/tmp/eldk-tst/usr/src/denx/BUILD/crosstool-0.35
    bash$ ls -ltr
    ...
    -rw-rw-r--   1 psl psl   152505 Dec  8 20:12 powerpc-linux.glibc.sum
    -rw-r--r--   1 psl psl   214893 Dec  8 20:12 glibc-output.tar.gz
    -rw-rw-r--   1 psl psl   221112 Dec  8 20:33 powerpc-linux.glibc-nptl.sum
    -rw-r--r--   1 psl psl    78306 Dec  8 20:33 glibc-nptl-output.tar.gz
    -rwxrwxr-x   1 psl psl 36668907 Dec  9 11:44 gcc.log
    -rwxrwxr-x   1 psl psl 12630561 Dec  9 11:44 g++.log
    -rw-rw-r--   1 psl psl    25126 Dec  9 11:44 powerpc-linux.gcc.sum
    -rw-rw-r--   1 psl psl    39314 Dec  9 11:45 powerpc-linux.binutils.sum
    
    The "sum" file contains the record of the every test run and (for the GCC and binutils tests) the testing summary in the form of "NN tests passed/YY tests failed" at the end of the file. For the glibc tests, no testing summary is provided. For failed glibc tests, the logged error output has the form of "Error n", where "n" is the decimal error code. The following commands can be used to get the summary of the glibc test results:
    bash$ grep LC_ALL powerpc-linux.glibc.sum | wc -l
    426
    bash$ grep "echo Error" powerpc-linux.glibc.sum | wc -l
    8
    
    In the example above, the result of the glibc testing is 8 failed tests of 426 tests total.

    The "log" files contain a detailed output of every test of the testsuite.

-- WolfgangDenk - 22 Jan 2006