3 #==================================================================================
4 # Copyright (c) 2019 Nokia
5 # Copyright (c) 2018-2019 AT&T Intellectual Property.
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #==================================================================================
20 # Mnemonic: vet_logging.sh
21 # Abstract: Drive the loging test and count the messages we see, and look for
22 # messages we don't expect. Exit good (0) if all looks good.
23 # Date: 16 September 2020
24 # Author: E. Scott Daniels
25 #-----------------------------------------------------------------------------------
27 echo "<INFO> log message vetting starts..."
29 expect=14 # number of good "should be written" messages expected
31 ./logging_test >/tmp/PID$$.out 2>&1
32 g=$( grep -c "should be written" /tmp/PID$$.out )
33 b=$( grep -c "should not be written" /tmp/PID$$.out )
38 echo "<FAIL> logging test produced $b unexpected to stderr"
41 echo "<INFO> no unexpected messages were found"
46 echo "<FAIL> logging test did not produce the expected number of messages to stderr"
47 echo "<INFO> expected $expect, saw $g"
50 echo "<INFO> logging test produced good message count ($g)"
56 echo "<INFO> --- test output ----"
58 echo "<INFO> ---------------------"
60 echo "<PASS> logging tests pass message output validation"