summaryrefslogtreecommitdiff
path: root/mk/testcases/lsb
blob: c691772eedc3f2f36d4a19d5359957f057362328 (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
#!/bin/sh

set -e

if [ $1 != "--short" ] ; then
    echo "Invalid parameter: $1" 1>&2
    exit 1
fi

if [ ! -f "${TESTCASE}" ] ; then
    echo "Testcase ${TESTCASE} not found" 1>&2
    exit 1
fi

case $(basename ${TESTCASE}) in
    lsb-*) ;;
    *) exit 1
esac

. ${TESTCASE}

if [ -z "$ID" ] ; then
     ID="$DISTRIB_ID"
fi
if [ -z "$DESCRIPTION" ] ; then
     DESCRIPTION="$DISTRIB_DESCRIPTION"
fi
if [ -z "$RELEASE" ] ; then
     RELEASE="$DISTRIB_RELEASE"
fi

case $2 in
    --id) echo ${ID} ;;
    --description) echo ${DESCRIPTION} ;;
    --release) echo ${RELEASE} ;;
    *)
	echo "Invalid paramter: $2" 1>&2
	exit 1;;
esac

exit 0