view tests/hostname.test @ 1650:a740a876c76c draft

Cleanup pass on printf. Alas, passing a union as the last argument to printf does not appear to work reliably, and there's no obvious way to manually assemble varargs in a portable manner. So I have to repeat the printf once for each data type. Oh well.
author Rob Landley <>
date Sun, 11 Jan 2015 01:22:36 -0600
parents 8700cbe1cb29
line wrap: on
line source


# Copyright 2014 Divya Kothari <>
# Copyright 2014 Naha Maggu <>

[ -f ] && .

#testing "name" "command" "result" "infile" "stdin"

# Get system hostname
hostnameExe=`which hostname`

# New hostname

testing "Hostname - Get" "hostname" "$hostnameOut\n" "" ""
testing "Hostname - Set, Get and then Reset" "hostname $NewHostname; hostname; hostname $hostnameOut; hostname" "$NewHostname\n$hostnameOut\n" "" ""