Mercurial > hg > toybox
annotate tests/hostname.test @ 1776:7bf68329eb3b draft default tip
Repository switched to git at https://github.com/landley/toybox
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 09 Apr 2015 02:28:32 -0500 |
parents | 8700cbe1cb29 |
children |
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" "" "" |