forked from vmware/govmomi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logs.bats
executable file
·57 lines (42 loc) · 932 Bytes
/
logs.bats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bats
load test_helper
@test "logs" {
esx_env
run govc logs
assert_success
nlogs=${#lines[@]}
# there should be plenty more than 1 line of hostd logs
[ $nlogs -ge 1 ]
# test -n flag
run govc logs -n $((nlogs - 10))
assert_success
[ ${#lines[@]} -le $nlogs ]
run govc logs -log vmkernel
assert_success
nlogs=${#lines[@]}
# there should be plenty more than 1 line of vmkernel logs
[ $nlogs -ge 1 ]
# test > 1 call to BrowseLog()
run govc logs -n 2002
assert_success
# -host ignored against ESX
run govc logs -host enoent
assert_success
run govc logs -log enoent
assert_failure
}
@test "logs.ls" {
esx_env
run govc logs.ls
assert_success
# -host ignored against ESX
run govc logs.ls -host enoent
assert_success
}
@test "logs opid" {
esx_env
id=$(new_id)
run env GOVC_OPERATION_ID="$id" govc events
assert_success
govc logs | grep "$id"
}