aboutsummaryrefslogtreecommitdiffstats
path: root/meta-agl-test/recipes-tests/agl-test-framework/agl-test-framework.bb
blob: a9bc236fc3c5422bd27278e53d5435ed6bcba626 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
SUMMARY = "Agl Test Framework"
HOMEPAGE = "https://git.automotivelinux.org/src/agl-test-framework/"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"

PN = 'agl-test-framework'
PV = '1'

SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/agl-test-framework;protocol=https;branch=master"
SRCREV = "fbae7ac31fd2a895f74c4c57508662eec15f40c1"

S = "${WORKDIR}/git"

# Notice:
# This is the list of all installed tests
#       On the installing board, if you get dirpath like:
#         /usr/AGL/agl-test/tests/bc/
#           Then, the test name here you should write down: bc
#       If you are installing LTP related files:
#         /usr/AGL/agl-test/tests/LTP/syscalls/
#           Then, the test name here you should write down: LTP/syscalls
#
FRAMEWORK_INSTALL_LIST = " \
    aio_stress \
    bash \
    bc \
    busybox \
    bzip2 \
    crashme \
    expat \
    gdk_pixbuf \
    glib2 \
    json_glib \
    libpam \
    libxml2 \
    linus_stress \
    LTP/math \
    LTP/cve \
    LTP/posix_conformance_tests \
    LTP/syscalls \
    openssl \
    python3 \
    stress_ng \
    zlib \
"

# Function of the structure installation
install_framework () {
    # basic essential pytest structure
    install -d ${D}/usr/bin/
    install -m 0755 ${WORKDIR}/git/agl-test ${D}/usr/bin/
    install -d ${D}/usr/AGL/agl-test/plugins/
    install -m 0644 ${WORKDIR}/git/pytest.ini ${D}/usr/AGL/agl-test/
    install -m 0644 ${WORKDIR}/git/plugins/* ${D}/usr/AGL/agl-test/plugins/
    install -d ${D}/usr/AGL/agl-test/template/
    install -m 0644 ${WORKDIR}/git/template/* ${D}/usr/AGL/agl-test/template/
    install -d ${D}/usr/AGL/agl-test/tests/
    install -m 0644 ${WORKDIR}/git/tests/__init__.py ${D}/usr/AGL/agl-test/tests/
    install -d ${D}/usr/AGL/agl-test/tests/LTP/
    install -m 0644 ${WORKDIR}/git/tests/LTP/*py ${D}/usr/AGL/agl-test/tests/LTP/
}

# Function of the test file installation
install_test_files () {
    for test_name in ${FRAMEWORK_INSTALL_LIST}; do
        # Step 1 : install basic python files (no check, this is common installation)
        install -d ${D}/usr/AGL/agl-test/tests/${test_name}
        install -m 0644 ${WORKDIR}/git/tests/${test_name}/*.py ${D}/usr/AGL/agl-test/tests/${test_name}/

        # Step 2 : install spec.json (check first, not common)
        if [ -f "${WORKDIR}/git/tests/${test_name}/spec.json" ];then
            install -m 0644 ${WORKDIR}/git/tests/${test_name}/spec.json ${D}/usr/AGL/agl-test/tests/${test_name}
        fi

        # Step 3 : install the resource folder (check first, not common)
        if [ -d "${WORKDIR}/git/tests/${test_name}/resource/" ];then
            install -d ${D}/usr/AGL/agl-test/tests/${test_name}/resource
            install -m 0644 ${WORKDIR}/git/tests/${test_name}/resource/* ${D}/usr/AGL/agl-test/tests/${test_name}/resource/
        fi
    done
}

# install agl-test-framework
do_install() {
    install_framework
    install_test_files
}

# Override PACKAGES
# base: basic structure of the agl-test-framework along with pytest modules
# fast: fast mode packages
# standard: standard mode packages
# extreme: extreme mode packages
#
PACKAGES = " \
    ${PN}-base \
    ${PN}-fast \
    ${PN}-standard \
    ${PN}-extreme \
"

# Filter for basic structure
FILES:${PN}-base += " \
    /usr/AGL/agl-test/plugins/* \
    /usr/AGL/agl-test/pytest.ini \
    /usr/AGL/agl-test/template/* \
    /usr/AGL/agl-test/tests/LTP/agl_test_ltp_base.py \
    /usr/AGL/agl-test/tests/LTP/__init__.py \
    /usr/AGL/agl-test/tests/__init__.py \
    /usr/bin/agl-test \
"

# Filter for fase mode
FILES:${PN}-fast = " \
     /usr/AGL/agl-test/tests/aio_stress/* \
     /usr/AGL/agl-test/tests/bc/* \
     /usr/AGL/agl-test/tests/expat/* \
     /usr/AGL/agl-test/tests/gdk_pixbuf/* \
     /usr/AGL/agl-test/tests/json_glib/* \
     /usr/AGL/agl-test/tests/libpam/* \
     /usr/AGL/agl-test/tests/LTP/math/* \
     /usr/AGL/agl-test/tests/stress_ng/* \
     /usr/AGL/agl-test/tests/zlib/* \
"

# Filter for standard mode
FILES:${PN}-standard = " \
     /usr/AGL/agl-test/tests/bash/* \
     /usr/AGL/agl-test/tests/busybox/* \
     /usr/AGL/agl-test/tests/bzip2/* \
     /usr/AGL/agl-test/tests/crashme/* \
     /usr/AGL/agl-test/tests/glib2/* \
     /usr/AGL/agl-test/tests/libxml2/* \
     /usr/AGL/agl-test/tests/linus_stress/* \
     /usr/AGL/agl-test/tests/LTP/cve/* \
     /usr/AGL/agl-test/tests/LTP/posix_conformance_tests/* \
     /usr/AGL/agl-test/tests/openssl/* \
"

# Filter for extreme mode
FILES:${PN}-extreme = " \
     /usr/AGL/agl-test/tests/python3/* \
     /usr/AGL/agl-test/tests/LTP/syscalls/* \
"

# Runtime dependency for basic structure
RDEPENDS:${PN}-base += " \
    python3-jinja2 \
    python3-pytest \
    python3-pytest-order \
"

# Runtime dependency for fast mode package
RDEPENDS:${PN}-fast += " \
    ltp \
    aio-stress \
    stress-ng \
"

# Runtime dependency for standard mode packages
RDEPENDS:${PN}-standard += " \
    linus-stress \
"

# Runtime dependency for extreme mode packages
RDEPENDS:${PN}-extreme += " \
    \
"