To run glibc test-suite on target without native toolchain we need to have the following 2 requirements:
-
Host executes tests on target via SSH so we need to have SSH server up and running on target. Moreover we need to either enable paswordless login via SSH or install user's SSH key on target so that execution scripts may connect to target via SSH without asking user for entering pasword all the time (there're 5k+ tests).
-
Host's filesystem must be accessible from target. Moreover paths must match exactly on both devices (i.e. "/home/username/glibc-testsuite" in both cases must be available and contain exectly the same data) because tests are being built on the fly and immediately get executed via SSH. Thus we need to mount host's filesystem with glibc testsuite on target.
This is simple - enable BR2_PACKAGE_OPENSSH in buildroot and patch "output/target/etc/ssh/sshd_config" with setting:
PermitRootLogin yes
PermitEmptyPasswords yes
This way there will be no need to install any keys.
We have at least 2 options here: SSHFS (since SSH server is already there) or NFS.
- Enable CONFIG_FUSE_FS in Linux kernel
- Enable BR2_PACKAGE_SSHFS in Buildroot
- On target run:
mkdir -p /home/username
sshfs -o idmap=user username@host_ip_address:/home/username /home/username
-
On host 1.1. Configure exports (in "/etc/exports"):
/home/username *(rw,all_squash,anonuid=username_uid,anongid=username_gid)
Note "all_squash" and "anonuid"/"anongid" are required for mapping target's user to you user on host. Otherwise use of "no_root_squash" is very dangerous as target's root will be treated as a root on your host and it: a) Might be really harmful b) Target will generate files on host's filesystem owned by host's "root" user so if glibc's testsuite is executed by normal user test results won't be accessible for it. And idea to run testsuite by local "root" is very dangerous so please don't do that! 1.2. Start NFS server 1.3. Open NFS and RPC-BIND ports in firewall
-
On target run:
mkdir -p /home/username
mount -t nfs host_ip_address:/home/username /home/username -o nolock
cd build/
make test-wrapper='__full_path_to__/scripts/cross-test-ssh.sh root@target_ip_address' xcheck
Use Google DNS which correctly resolves IPv6 names to addresses and thus tst-getaddrinfo4
passes reliably:
echo "nameserver 8.8.8.8" > /etc/resolv.conf
Get all available results while tests are still being executed:
find . -type f -name '*.test-result' -exec cat {} \; > all-tests.txt