File: start_systemd_journal_test.sh

package info (click to toggle)
dlt-daemon 3.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,296 kB
  • sloc: ansic: 58,041; cpp: 16,199; sh: 1,769; xml: 1,440; python: 376; makefile: 32
file content (38 lines) | stat: -rwxr-xr-x 891 bytes parent folder | download | duplicates (8)
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
#!/bin/bash

#build and install with SYSTEMD_JOURNAL=ON
mkdir ../build
cd ../build/
cmake -DWITH_SYSTEMD_JOURNAL=ON -DWITH_DLT_UNIT_TESTS=ON ..
make
sudo make install
#enable SYSTEMD_JOURNAL in config file
sudo vim -esnc '%s/JournalEnable = 0/JournalEnable = 1/g|:wq' /usr/local/etc/dlt-system.conf
#start dlt-daemon
dlt-daemon &
sleep 1
#start dlt_system
sudo dlt-system &
sleep 1
#send 10 times "DLT SYSTEM JOURNAL TEST"
for i in {1..1000}
do
        logger DLT SYSTEM JOURNAL TEST
done
#start receiver
./../build/tests/dlt_test_receiver -s localhost &
sleep 1
pid=$!
wait $pid
exitcode=$?
# kill processes, receiver automatically killed with daemon
pkill dlt-daemon
sudo pkill dlt-system
# if exit code == 159 , test successfull
tput setaf 1
if [ $exitcode == 159 ]; then
        echo "Systemd Journal tests successfull."
else
        echo "Systemd Journal tests failed."
fi
tput setaf 7