From 387edf547eb09b27ca6d49772eb048d729f09cf4 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 20 Sep 2014 13:09:14 -0500 Subject: Move testsuite out of scripts/test into its own top level tests directory, and make ctrl-c kill "make test" more reliably. --- tests/hostname.test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/hostname.test (limited to 'tests/hostname.test') diff --git a/tests/hostname.test b/tests/hostname.test new file mode 100644 index 00000000..11948458 --- /dev/null +++ b/tests/hostname.test @@ -0,0 +1,18 @@ +#!/bin/bash + +# Copyright 2014 Divya Kothari +# Copyright 2014 Naha Maggu + +[ -f testing.sh ] && . testing.sh + +#testing "name" "command" "result" "infile" "stdin" + +# Get system hostname +hostnameExe=`which hostname` +hostnameOut=`$hostnameExe` + +# New hostname +NewHostname="NewHostName.system" + +testing "Hostname - Get" "hostname" "$hostnameOut\n" "" "" +testing "Hostname - Set, Get and then Reset" "hostname $NewHostname; hostname; hostname $hostnameOut; hostname" "$NewHostname\n$hostnameOut\n" "" "" -- cgit v1.2.3