This repository was archived by the owner on Feb 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +62
-0
lines changed Expand file tree Collapse file tree 5 files changed +62
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,19 @@ hyper::test::run_attached_pod() {
51
51
hyper run --rm -a -p $1
52
52
}
53
53
54
+ hyper::test::hostname () {
55
+ hname=$( hyper::test::run_attached_pod ${HYPER_ROOT} /hack/pods/hostname.pod | tr -d ' \r' )
56
+ echo " hostname is ${hname} , expected myname"
57
+ [ " ${hname} x" != " mynamex" ] && return 1
58
+
59
+ echo " check long hostname"
60
+ hyper::test::run_attached_pod ${HYPER_ROOT} /hack/pods/hostname-err-long.pod && return 1
61
+ echo " check invalid hostname"
62
+ hyper::test::run_attached_pod ${HYPER_ROOT} /hack/pods/hostname-err-char.pod && return 1
63
+
64
+ return 0
65
+ }
66
+
54
67
hyper::test::insert_file () {
55
68
res=0
56
69
count=5
Original file line number Diff line number Diff line change
1
+ {
2
+ "id": "host-name-tester",
3
+ "hostname": "/myname",
4
+ "containers" : [{
5
+ "name": "file-tester",
6
+ "image": "busybox:latest",
7
+ "workdir": "/",
8
+ "command": ["hostname"]
9
+ }],
10
+ "resource": {
11
+ "vcpu": 1,
12
+ "memory": 512
13
+ },
14
+ "volumes": [],
15
+ "tty": true
16
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "id": "host-name-tester",
3
+ "hostname": "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn",
4
+ "containers" : [{
5
+ "name": "file-tester",
6
+ "image": "busybox:latest",
7
+ "workdir": "/",
8
+ "command": ["hostname"]
9
+ }],
10
+ "resource": {
11
+ "vcpu": 1,
12
+ "memory": 512
13
+ },
14
+ "volumes": [],
15
+ "tty": true
16
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "id": "host-name-tester",
3
+ "hostname": "myname",
4
+ "containers" : [{
5
+ "name": "file-tester",
6
+ "image": "busybox:latest",
7
+ "workdir": "/",
8
+ "command": ["hostname"]
9
+ }],
10
+ "resource": {
11
+ "vcpu": 1,
12
+ "memory": 512
13
+ },
14
+ "volumes": [],
15
+ "tty": true
16
+ }
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ __EOF__
156
156
157
157
hyper::test::exitcode
158
158
hyper::test::exec
159
+ hyper::test::hostname
159
160
hyper::test::insert_file
160
161
hyper::test::map_file
161
162
hyper::test::with_volume
You can’t perform that action at this time.
0 commit comments