summaryrefslogtreecommitdiffstats
path: root/tests/lib/inspector
blob: 24221642534ba07dd37b4ffe89dc0d8e3a53c0bb (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
#!/bin/bash

INSPECTOR_TYPE=${INSPECTOR_TYPE:-sample}

function is_inspector_supported {
    local inspector="$1"
    [[ -f $TOP_DIR/lib/inspectors/$inspector ]]
}

function is_inspector {
    local inspector="$1"
    [[ $inspector == $INSPECTOR_TYPE ]]
}

function start_inspector {
    start_inspector_$INSPECTOR_TYPE
}

function stop_inspector {
    stop_inspector_$INSPECTOR_TYPE
}

function cleanup_inspector {
    cleanup_inspector_$INSPECTOR_TYPE
}


if ! is_inspector_supported $INSPECTOR_TYPE; then
    die $LINENO "INSPECTOR_TYPE=$INSPECTOR_TYPE is not supported."
fi

source $TOP_DIR/lib/inspectors/$INSPECTOR_TYPE