annotate scripts/test/hostname.test @ 1457:d9e937417636 draft

Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
author Divya Kothari <divya.s.kothari@gmail.com>
date Wed, 03 Sep 2014 13:38:18 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1457
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
1 #!/bin/bash
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
2
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
3 # Copyright 2014 Divya Kothari <divya.s.kothari@gmail.com>
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
4 # Copyright 2014 Naha Maggu <maggu.neha@gmail.com>
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
5
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
6 [ -f testing.sh ] && . testing.sh
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
7
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
8 #testing "name" "command" "result" "infile" "stdin"
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
9
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
10 # Get system hostname
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
11 hostnameExe=`which hostname`
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
12 hostnameOut=`$hostnameExe`
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
13
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
14 # New hostname
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
15 NewHostname="NewHostName.system"
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
16
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
17 testing "Hostname - Get" "hostname" "$hostnameOut\n" "" ""
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
18 testing "Hostname - Set, Get and then Reset" "hostname $NewHostname; hostname; hostname $hostnameOut; hostname" "$NewHostname\n$hostnameOut\n" "" ""