summaryrefslogtreecommitdiff
path: root/tests/gtest_dlt_daemon_logstorage.sh
blob: 704feb7ae6947b14e9f06199b7ecb287f2cf16f6 (plain)
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
#!/bin/sh
########################################################################################
#file            : g_test_dlt_daemon_logstorage.sh
#
#Description     : logstorage unit test preparation
#
#Author Name     : Onkar Palkar
#Email Id        : onkar.palkar@wipro.com
#
#History         : Last modified date : 02/09/2016
########################################################################################
#
# Function:    -cleanup()
#
# Description    -Delete dlt_logstorage.conf file from tmp folder if present
#
# Return    -Zero on success
#        -Non zero on failure
#

cleanup()
{
    tmpPath=/tmp
    cd $tmpPath
    rm -rf $tmpPath/dlt_logstorage.conf
    return 0
}

#
# Function:     -setupTest()
#
# Description   -create logstorage.conf file
#
# Return        -Zero on success
#               -Non zero on failure
#
setupTest()
{
    touch $tmpPath/dlt_logstorage.conf
    if [ $? -eq '1' ]
    then
        echo "Error in creating dlt_logstorage.conf file"
        return 1
    fi
    echo "[FILTER1]" >>$tmpPath/dlt_logstorage.conf
    echo "LogAppName=DLST" >>$tmpPath/dlt_logstorage.conf
    echo "ContextName=.*" >>$tmpPath/dlt_logstorage.conf
    echo "LogLevel=DLT_LOG_ERROR" >>$tmpPath/dlt_logstorage.conf
    echo "File=Test" >>$tmpPath/dlt_logstorage.conf
    echo "FileSize=1000000" >>$tmpPath/dlt_logstorage.conf
    echo "NOFiles=1" >>$tmpPath/dlt_logstorage.conf
    return 0
}
#main function
########################################################################################
cleanup
setupTest