-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest_logwarn
executable file
·104 lines (95 loc) · 4.96 KB
/
test_logwarn
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash -e
set -o pipefail
out=$(env options="-f /dev/null -z" file=in.log sh -ex ./logwarn_openqa) || true
declare -i testnum=0
declare -i rc=0
pass() {
testnum+=1
echo "ok $testnum - $1"
}
fail() {
testnum+=1
echo "not ok $testnum - $1"
rc=1
}
done-testing() {
echo "1..$testnum"
}
is-ignored() {
local string=$1 label=$2
label=${label:-"String >>$string<< is ignored"}
if echo "$out" | grep -q "$string"; then
fail "$label"
else
pass "$label"
fi
}
is-included() {
local string=$1 label=$2
label=${label:-"String >>$string<< is included"}
if echo "$out" | grep -q "$string"; then
pass "$label"
else
fail "$label"
fi
}
echo "test error messages are included"
is-included ':error.*File iso/bar.iso is not a registered asset'
is-included ':error.*MISSING S:scheduled R:none'
is-included 'FOOBAR='
echo "test debug and info messages are not included"
is-ignored '\[19382:info\] GRU: removing /var/lib/openqa/factory/iso/whocares.iso'
is-ignored '\[websockets:debug\] \[DBIx debug\] Took 0.00216508 seconds executed: UPDATE workers ...'
echo "not prefixed output is NOT included"
is-ignored 'more output that is not properly prefixed'
echo "multi-line debug is not included"
is-ignored '\[Thu Oct 6 01:15:54 2016\] \[27316:debug\] dispatching IPC job_grab to scheduler: \['
is-ignored 'blocking => 0,'
is-ignored 'cpu_modelname => undef,'
is-ignored '^\]$'
echo "New style openQA log format is supported"
is-included '\[2018-02-06T04:02:24.0435 CET\] \[error\] The world is coming to an end'
echo "Known and blacklisted log lines are not included"
is-ignored '\[4608:warn\] 619442 got a status update but has no worker. huh?'
is-ignored '\[8980:warn\] 619391 got an artefact but has no worker. huh?'
is-ignored ':error.*Asset iso/foo.iso is not in any job group'
is-ignored 'is not in any job group, will delete in'
is-ignored '\[websockets:warn\] dead job 813295 aborted and duplicated 813306'
is-ignored '\[1719:warn\] AMQP connection error: Connect timeout'
is-ignored '\[25898:warn\] AMQP connection closed'
is-ignored '\[31798:warn\] no products found, retrying version wildcard'
is-ignored '\[14008:warn\] START_AFTER_TEST=RAID0:ppc64le not found - check for typos and dependency cycles'
is-ignored 'Worker not found for given connection during connection close'
is-ignored '\[15550:warn\] AMQP connection error: SSL connect attempt failed with unknown error'
is-ignored "can't remove d81/349/2cab90e04faac6f7a112c5ed90.png"
is-ignored '\[scheduler:warn\] openqaworker5:20 wants to grab a new job - killing the old one: 993795'
is-ignored '\[websockets:error] Unknown property received from worker 523'
is-ignored '\[websockets:warn] dead job 997744 aborted as incomplete'
is-ignored '\[10709:error\] Failed to login: OpenID provider returned invalid data\. Please retry again'
is-ignored '\[websockets:warn\] A message received from unknown worker connection'
is-ignored '\[28861:warn] Stopping worker 4210 immediately'
is-ignored '\[4087:error] org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.'
is-ignored '\[25795:warn] AMQP connection error: No route to host'
is-ignored '\[22402:error] Could not parse needle: installation-bootloader-options-20171019 for sle 15'
is-ignored '\[7532:warn] /var/lib/openqa/share/tests/sle/products/sle/needles/installation-bootloader-options-20171019.json: No such file or directory'
is-ignored '\[websockets:error] Unknown property received from worker 523'
is-ignored '\[websockets:warn] dead job 997744 aborted as incomplete'
is-ignored 'error\] .*api_description'
is-ignored 'DBI Exception'
is-ignored '\[.*warn\] A message received from unknown worker connection'
is-ignored '\[.*warn\] Unable to get filename'
is-ignored '\[.*warn\] has no child, check its machine placed'
is-ignored '\[error\] DBIx.*number of parameters must be between.*OpenQA/WebAPI/Controller/API/V1/Job.pm'
is-ignored '\[error\] mkdir /var/lib/openqa/images/0bf/862/.thumbs: File exists at /usr/share/openqa/script/../lib/OpenQA/Schema/Result/Jobs.pm line 1227'
is-ignored '\[error\].* DBIx::Class::Row::update(): Can.t update OpenQA::Schema::Result::JobLocks'
is-ignored '\[error\].* Cannot read symbolic link .*/.run_last): No such file or directory'
is-ignored '\[error\].* Needle file .*.json not found within /var/lib/openqa/share/tests/opensuse/products/opensuse/needles.'
is-ignored '\[error\].* Publishing opensuse.openqa.job.restart failed: Connect timeout (9 attempts left)'
is-ignored '\[warn\].* Unable to wakeup scheduler: Request timeout'
is-ignored '\[warn\].* fatal: Invalid revision range .*\.\.'
is-ignored '\[warn\] \[pid:[0-9]*\] $'
is-ignored '\[error\].*cmd returned 32768$'
is-ignored '\[error\] Worker 17519 has no heartbeat'
done-testing
# explicitly exit with $rc unless we are run by prove
[[ -n $HARNESS_ACTIVE ]] || exit $rc