Skip to content

GLibC Testsuite Execution

cupertinomiranda edited this page Oct 15, 2021 · 2 revisions

GLibc Testsuite execution on QEMU

Cross execution of glibc testsuite has the following requirements:

  • ssh accessibility of the target,
  • contains a mount point of source and build directories of glibc, which would get updated on both sides simultaneously (something like NFS).
  • NFS support on both host and target machines.

Steps:

  1. copy glibc source to root close directory to avoid makfiles/scripts to contain long paths, for example /glibc_testing.
  2. build glibc as it is built by the toolchain, but in a single stage using the glibc toolchain to be tested.
  3. I use the following directory structure:
      /glibc_testing
         |-> source   - source code in
         |-> build    - where I build glibc
  1. add in /etc/exports, a NFS share to the /glibc_testing (example for QEmu with tap below):
      /glibc_test 192.168.218.0/22(rw,no_root_squash,sync)
  1. Boot the linux image that will be used to verify glibc.
  2. setup ssh such that you can login without a password. The glibc script will use SSH many times. I usually login as root on my system to do this. You can also create a special user for the purpose making sure that UID are the same on host/target machines.
  3. On the target mount the NFS share:
      mkdir -p /glibc_testing
      mount -t nfs -o nolock 192.168.218.1:/glibc_testing /glibc_testing
  1. On the host you should execute the following command in /glibc_testing/build:
      make test-wrapper='/glibc_testing/source/scripts/cross-test-ssh.sh root@192.168.218.100' tests

There are other make targets instead of tests that can be more appropriate to execute (xtests, check, xcheck). Vineet should know more which one is more appropriate.

More details on how to execute glibc testsuite can be found in: GLibC Testsuite Wiki

TAP Networking

To enable tap on qemu: -netdev tap,id=mynet0,ifname=tap0,script=no,downscript=no -device virtio-net-device,netdev=mynet0

This will create a tap0 device on the host, which will need to set an ip and enable a dhcpd server to make it easier. I do with with the following script:

#!/bin/bash
killall dnsmasq
ip link set tap0 down
ip addr add 192.168.218.1/24 dev tap0
ip link set tap0 up
dnsmasq --interface=tap0 --bind-interfaces --dhcp-range=192.168.218.100,192.168.218.200
Clone this wiki locally