[Toybox] Multiple OS support in tests

Ed Maste emaste at freebsd.org
Fri Jan 18 09:59:42 PST 2019


I applied a few hacks to run tests on FreeBSD - changes like (hostname.test):

-HOST="$(cat /proc/sys/kernel/hostname)"
+HOST=$(sysctl -n kern.hostname)

Of course this isn't an acceptable upstream change; what's the most
desirable way to handle these? One approach would be something like:

case $(uname -s) in
FreeBSD)
    HOST=$(sysctl -n kern.hostname)
    ;;
Linux)
    HOST=$(cat /proc/sys/kernel/hostname)
    ;;
esac

but perhaps this is too verbose in the individual tests?



More information about the Toybox mailing list