summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlbonn <lbonn@users.noreply.github.com>2019-03-12 17:50:31 +0100
committerGitHub <noreply@github.com>2019-03-12 17:50:31 +0100
commit1e569e4def74e8b161833c4874888a7e514b67b1 (patch)
tree7db30479efae5f322144f30f331f6aaacdb43cee
parentcf488eca954a7dd19b86c7ad0c1b881e45712a93 (diff)
parent7a39c14aa24be4cac100ba2beaf13d52a382f719 (diff)
downloadmeta-updater-1e569e4def74e8b161833c4874888a7e514b67b1.tar.gz
Merge pull request #500 from advancedtelematic/test/OTA-2137/ptest-run
ptest for aktualizr
-rw-r--r--README.adoc13
-rw-r--r--lib/oeqa/selftest/cases/updater.py2
-rw-r--r--recipes-devtools/valgrind/files/bug344802-unhandled-0xec510f1e.patch250
-rw-r--r--recipes-devtools/valgrind/valgrind_%.bbappend4
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb34
-rwxr-xr-xrecipes-sota/aktualizr/files/run-ptest16
6 files changed, 315 insertions, 4 deletions
diff --git a/README.adoc b/README.adoc
index b23f04b..f3aef45 100644
--- a/README.adoc
+++ b/README.adoc
@@ -219,6 +219,19 @@ oe-selftest --run-tests updater
219 219
220For more information about oe-selftest, including details about how to run individual test modules or classes, please refer to the https://wiki.yoctoproject.org/wiki/Oe-selftest[Yocto Project wiki]. 220For more information about oe-selftest, including details about how to run individual test modules or classes, please refer to the https://wiki.yoctoproject.org/wiki/Oe-selftest[Yocto Project wiki].
221 221
222== Aktualizr test suite with ptest
223
224The meta-updater layer includes support for running parts of the aktualizr test suite on deployed devices through link:https://wiki.yoctoproject.org/wiki/Ptest[Yocto's ptest functionality]. Since it adds significant build time cost, it is currently disabled by default. To enable it, add the following to your `conf/local.conf`:
225
226```
227PTEST_ENABLED_pn-aktualizr = "1"
228IMAGE_INSTALL_append += " aktualizr-ptest ptest-runner "
229```
230
231Be aware that it will add several hundreds of MB to the generated file system.
232
233The aktualizr tests will now be part of the deployed ptest suite, which can be run by calling `ptest-runner`. Alternatively, the required files and run script can be found in `/usr/lib/aktualizr/ptest`.
234
222== Manual provisoning 235== Manual provisoning
223 236
224As described in <<sota-related-variables-in-localconf,SOTA-related variables in local.conf>> section you can set `SOTA_DEPLOY_CREDENTIALS` to `0` to prevent deploying credentials to the built `wic` image. In this case you get a generic image that you can use e.g. on a production line to flash a series of devices. The cost of this approach is that this image is half-baked and should be provisioned before it can connect to the backend. 237As described in <<sota-related-variables-in-localconf,SOTA-related variables in local.conf>> section you can set `SOTA_DEPLOY_CREDENTIALS` to `0` to prevent deploying credentials to the built `wic` image. In this case you get a generic image that you can use e.g. on a production line to flash a series of devices. The cost of this approach is that this image is half-baked and should be provisioned before it can connect to the backend.
diff --git a/lib/oeqa/selftest/cases/updater.py b/lib/oeqa/selftest/cases/updater.py
index 898096c..473b2a8 100644
--- a/lib/oeqa/selftest/cases/updater.py
+++ b/lib/oeqa/selftest/cases/updater.py
@@ -191,7 +191,7 @@ class ManualControlTests(OESelftestTestCase):
191 """ 191 """
192 sleep(20) 192 sleep(20)
193 stdout, stderr, retcode = self.qemu_command('aktualizr-info') 193 stdout, stderr, retcode = self.qemu_command('aktualizr-info')
194 self.assertIn(b'Can\'t open database', stdout, 194 self.assertIn(b'Can\'t open database', stderr,
195 'Aktualizr should not have run yet' + stderr.decode() + stdout.decode()) 195 'Aktualizr should not have run yet' + stderr.decode() + stdout.decode())
196 196
197 stdout, stderr, retcode = self.qemu_command('aktualizr once') 197 stdout, stderr, retcode = self.qemu_command('aktualizr once')
diff --git a/recipes-devtools/valgrind/files/bug344802-unhandled-0xec510f1e.patch b/recipes-devtools/valgrind/files/bug344802-unhandled-0xec510f1e.patch
new file mode 100644
index 0000000..a25f541
--- /dev/null
+++ b/recipes-devtools/valgrind/files/bug344802-unhandled-0xec510f1e.patch
@@ -0,0 +1,250 @@
1diff --git a/VEX/priv/guest_arm_defs.h b/VEX/priv/guest_arm_defs.h
2index 2ccbe4398..90312fbd4 100644
3--- a/VEX/priv/guest_arm_defs.h
4+++ b/VEX/priv/guest_arm_defs.h
5@@ -350,6 +350,10 @@ typedef
6 }
7 ARMCondcode;
8
9+extern UInt arm_dirtyhelper_MRS_CNTFRQ ( void );
10+extern ULong arm_dirtyhelper_MRRS_CNTVCT ( void );
11+extern ULong arm_dirtyhelper_MRRS_CNTPCT ( void );
12+
13 #endif /* ndef __VEX_GUEST_ARM_DEFS_H */
14
15 /*---------------------------------------------------------------*/
16diff --git a/VEX/priv/guest_arm_helpers.c b/VEX/priv/guest_arm_helpers.c
17index 8a028736e..89b17ce7b 100644
18--- a/VEX/priv/guest_arm_helpers.c
19+++ b/VEX/priv/guest_arm_helpers.c
20@@ -1445,6 +1445,53 @@ VexGuestLayout
21 };
22
23
24+UInt arm_dirtyhelper_MRS_CNTFRQ ( void )
25+{
26+#if __ARM_ARCH_ISA_ARM //{
27+ UInt w = 0x55555555UL; /* overwritten */
28+ __asm__ __volatile__("mrc p15, 0, %0, c14, c0, 0" : "=r"(w));
29+ return w;
30+#elif __ARM_ARCH_ISA_A64 //}{
31+ UInt w;
32+ __asm__ __volatile__("mrs %0,cntfrq_el0": "=r"(w));
33+ return w;
34+#else //}{
35+ return 0;
36+#endif //}
37+}
38+
39+ULong arm_dirtyhelper_MRRS_CNTVCT ( void )
40+{
41+#if __ARM_ARCH_ISA_ARM //}{
42+ UInt w0;
43+ UInt w1;
44+ __asm__ __volatile__("mrrc p15, 1, %0, %1, c14" : "=r"(w0), "=r"(w1));
45+ return (((ULong)w1)<<32) | w0;
46+#elif __ARM_ARCH_ISA_A64 //{
47+ ULong w;
48+ __asm__ __volatile__("mrs %0, cntvct_el0" : "=r"(w));
49+ return w;
50+#else //}{
51+ return 0;
52+#endif //}
53+}
54+
55+ULong arm_dirtyhelper_MRRS_CNTPCT ( void )
56+{
57+#if __ARM_ARCH_ISA_ARM //}{
58+ UInt w0;
59+ UInt w1;
60+ __asm__ __volatile__("mrrc p15, 0, %0, %1, c14" : "=r"(w0), "=r"(w1));
61+ return (((ULong)w1)<<32) | w0;
62+#elif __ARM_ARCH_ISA_A64 //{
63+ ULong w;
64+ __asm__ __volatile__("mrs %0, cntpct_el0" : "=r"(w));
65+ return w;
66+#else //}{
67+ return 0;
68+#endif //}
69+}
70+
71 /*---------------------------------------------------------------*/
72 /*--- end guest_arm_helpers.c ---*/
73 /*---------------------------------------------------------------*/
74diff --git a/VEX/priv/guest_arm_toIR.c b/VEX/priv/guest_arm_toIR.c
75index d858c85e0..f96af92c4 100644
76--- a/VEX/priv/guest_arm_toIR.c
77+++ b/VEX/priv/guest_arm_toIR.c
78@@ -18755,6 +18755,87 @@ DisResult disInstr_ARM_WRK (
79 /* fall through */
80 }
81
82+ /* CNTFRQ: mrc p15, 0, rX, c14, c0, 0 */
83+ if (0x0e1e0f10 == (insn & 0x0FFF0FFF)) {
84+ UInt rD = INSN(15,12);
85+ if (rD <= 14) {
86+ /* skip r15, that's too stupid to handle */
87+ IRTemp val = newTemp(Ity_I32);
88+ IRExpr** args = mkIRExprVec_0();
89+ IRDirty* d = unsafeIRDirty_1_N(
90+ val,
91+ 0/*regparms*/,
92+ "arm_dirtyhelper_MRS_CNTFRQ",
93+ &arm_dirtyhelper_MRS_CNTFRQ,
94+ args
95+ );
96+ /* execute the dirty call, dumping the result in val. */
97+ stmt( IRStmt_Dirty(d) );
98+ putIRegA(rD, mkexpr(val), condT, Ijk_Boring);
99+ DIP("mrc%s p15, 0, r%u, c14, c0, 0\n", nCC(INSN_COND), rD);
100+ goto decode_success;
101+ }
102+ /* fall through */
103+ }
104+
105+ /* CNTPCT */
106+ if (0x0c500f0e == (insn & 0x0FF00FFF)) {
107+ UInt rDhi = INSN(19,16);
108+ UInt rDlo = INSN(15,12);
109+ if (rDhi <= 14 && rDlo <= 14) {
110+ /* skip r15, that's too stupid to handle */
111+ IRTemp resHi = newTemp(Ity_I32);
112+ IRTemp resLo = newTemp(Ity_I32);
113+ IRTemp val = newTemp(Ity_I64);
114+ IRExpr** args = mkIRExprVec_0();
115+ IRDirty* d = unsafeIRDirty_1_N(
116+ val,
117+ 0/*regparms*/,
118+ "arm_dirtyhelper_MRRS_CNTPCT",
119+ &arm_dirtyhelper_MRRS_CNTPCT,
120+ args
121+ );
122+ /* execute the dirty call, dumping the result in val. */
123+ stmt( IRStmt_Dirty(d) );
124+ assign( resHi, unop(Iop_64HIto32, mkexpr(val)) );
125+ assign( resLo, unop(Iop_64to32, mkexpr(val)) );
126+ putIRegA( rDhi, mkexpr(resHi), condT, Ijk_Boring );
127+ putIRegA( rDlo, mkexpr(resLo), condT, Ijk_Boring );
128+ DIP("mrrc%s p15, 0, r%u, r%u, c14\n", nCC(INSN_COND), rDlo, rDhi);
129+ goto decode_success;
130+ }
131+ /* fall through */
132+ }
133+
134+ /* CNTVCT */
135+ if (0x0c500f1e == (insn & 0x0FF00FFF)) {
136+ UInt rDhi = INSN(19,16);
137+ UInt rDlo = INSN(15,12);
138+ if (rDhi <= 14 && rDlo <= 14) {
139+ /* skip r15, that's too stupid to handle */
140+ IRTemp resHi = newTemp(Ity_I32);
141+ IRTemp resLo = newTemp(Ity_I32);
142+ IRTemp val = newTemp(Ity_I64);
143+ IRExpr** args = mkIRExprVec_0();
144+ IRDirty* d = unsafeIRDirty_1_N(
145+ val,
146+ 0/*regparms*/,
147+ "arm_dirtyhelper_MRRS_CNTVCT",
148+ &arm_dirtyhelper_MRRS_CNTVCT,
149+ args
150+ );
151+ /* execute the dirty call, dumping the result in val. */
152+ stmt( IRStmt_Dirty(d) );
153+ assign( resHi, unop(Iop_64HIto32, mkexpr(val)) );
154+ assign( resLo, unop(Iop_64to32, mkexpr(val)) );
155+ putIRegA( rDhi, mkexpr(resHi), condT, Ijk_Boring );
156+ putIRegA( rDlo, mkexpr(resLo), condT, Ijk_Boring );
157+ DIP("mrrc%s p15, 1, r%u, r%u, c14\n", nCC(INSN_COND), rDlo, rDhi);
158+ goto decode_success;
159+ }
160+ /* fall through */
161+ }
162+
163 /* Handle various kinds of barriers. This is rather indiscriminate
164 in the sense that they are all turned into an IR Fence, which
165 means we don't know which they are, so the back end has to
166@@ -23196,6 +23277,84 @@ DisResult disInstr_THUMB_WRK (
167 /* fall through */
168 }
169
170+ /* CNTFRQ: mrc p15, 0, rX, c14, c0, 0 */
171+ if ((INSN0(15,0) == 0xee1e) && (INSN1(11,0) == 0xf10)) {
172+ UInt rD = INSN1(15,12);
173+ if (!isBadRegT(rD)) {
174+ IRTemp val = newTemp(Ity_I32);
175+ IRExpr** args = mkIRExprVec_0();
176+ IRDirty* d = unsafeIRDirty_1_N(
177+ val,
178+ 0/*regparms*/,
179+ "arm_dirtyhelper_MRS_CNTFRQ",
180+ &arm_dirtyhelper_MRS_CNTFRQ,
181+ args
182+ );
183+ /* execute the dirty call, dumping the result in val. */
184+ stmt( IRStmt_Dirty(d) );
185+ putIRegT(rD, mkexpr(val), condT);
186+ DIP("mrc p15, 0, r%u, c14, c0, 0\n", rD);
187+ goto decode_success;
188+ }
189+ /* fall through */
190+ }
191+
192+ /* CNTPCT */
193+ if ((INSN0(15,4) == 0xec5) && (INSN1(11,0) == 0xf0e)) {
194+ UInt rDhi = INSN0(3,0);
195+ UInt rDlo = INSN1(15,12);
196+ if (!isBadRegT(rDhi) && !isBadRegT(rDlo)) {
197+ IRTemp resHi = newTemp(Ity_I32);
198+ IRTemp resLo = newTemp(Ity_I32);
199+ IRTemp val = newTemp(Ity_I64);
200+ IRExpr** args = mkIRExprVec_0();
201+ IRDirty* d = unsafeIRDirty_1_N(
202+ val,
203+ 0/*regparms*/,
204+ "arm_dirtyhelper_MRRS_CNTPCT",
205+ &arm_dirtyhelper_MRRS_CNTPCT,
206+ args
207+ );
208+ /* execute the dirty call, dumping the result in val. */
209+ stmt( IRStmt_Dirty(d) );
210+ assign( resHi, unop(Iop_64HIto32, mkexpr(val)) );
211+ assign( resLo, unop(Iop_64to32, mkexpr(val)) );
212+ putIRegT( rDhi, mkexpr(resHi), condT );
213+ putIRegT( rDlo, mkexpr(resLo), condT );
214+ DIP("mrrc p15, 0, r%u, r%u, c14\n", rDlo, rDhi);
215+ goto decode_success;
216+ }
217+ /* fall through */
218+ }
219+
220+ /* CNTVCT */
221+ if ((INSN0(15,4) == 0xec5) && (INSN1(11,0) == 0xf1e)) {
222+ UInt rDhi = INSN0(3,0);
223+ UInt rDlo = INSN1(15,12);
224+ if (!isBadRegT(rDhi) && !isBadRegT(rDlo)) {
225+ IRTemp resHi = newTemp(Ity_I32);
226+ IRTemp resLo = newTemp(Ity_I32);
227+ IRTemp val = newTemp(Ity_I64);
228+ IRExpr** args = mkIRExprVec_0();
229+ IRDirty* d = unsafeIRDirty_1_N(
230+ val,
231+ 0/*regparms*/,
232+ "arm_dirtyhelper_MRRS_CNTVCT",
233+ &arm_dirtyhelper_MRRS_CNTVCT,
234+ args
235+ );
236+ /* execute the dirty call, dumping the result in val. */
237+ stmt( IRStmt_Dirty(d) );
238+ assign( resHi, unop(Iop_64HIto32, mkexpr(val)) );
239+ assign( resLo, unop(Iop_64to32, mkexpr(val)) );
240+ putIRegT( rDhi, mkexpr(resHi), condT );
241+ putIRegT( rDlo, mkexpr(resLo), condT );
242+ DIP("mrrc p15, 1, r%u, r%u, c14\n", rDlo, rDhi);
243+ goto decode_success;
244+ }
245+ /* fall through */
246+ }
247+
248 /* ------------------- CLREX ------------------ */
249 if (INSN0(15,0) == 0xF3BF && INSN1(15,0) == 0x8F2F) {
250 /* AFAICS, this simply cancels a (all?) reservations made by a
diff --git a/recipes-devtools/valgrind/valgrind_%.bbappend b/recipes-devtools/valgrind/valgrind_%.bbappend
new file mode 100644
index 0000000..c5f7c31
--- /dev/null
+++ b/recipes-devtools/valgrind/valgrind_%.bbappend
@@ -0,0 +1,4 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
2
3# from https://bugs.kde.org/show_bug.cgi?id=344802 (John Reiser)
4SRC_URI += "file://bug344802-unhandled-0xec510f1e.patch"
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 97f784f..49c4e5e 100755
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -6,10 +6,13 @@ LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" 6LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3"
7 7
8DEPENDS = "boost curl openssl libarchive libsodium sqlite3 asn1c-native" 8DEPENDS = "boost curl openssl libarchive libsodium sqlite3 asn1c-native"
9DEPENDS_append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' coreutils-native ostree-native aktualizr-native ', '', d)}"
9RDEPENDS_${PN}_class-target = "aktualizr-check-discovery aktualizr-configs lshw" 10RDEPENDS_${PN}_class-target = "aktualizr-check-discovery aktualizr-configs lshw"
10RDEPENDS_${PN}-secondary = "aktualizr-check-discovery" 11RDEPENDS_${PN}-secondary = "aktualizr-check-discovery"
11RDEPENDS_${PN}-host-tools = "aktualizr aktualizr-repo aktualizr-cert-provider ${@bb.utils.contains('PACKAGECONFIG', 'sota-tools', 'garage-deploy garage-push', '', d)}" 12RDEPENDS_${PN}-host-tools = "aktualizr aktualizr-repo aktualizr-cert-provider ${@bb.utils.contains('PACKAGECONFIG', 'sota-tools', 'garage-deploy garage-push', '', d)}"
12 13
14RDEPENDS_${PN}-ptest += "bash cmake curl python3-modules sqlite3 valgrind"
15
13PV = "1.0+git${SRCPV}" 16PV = "1.0+git${SRCPV}"
14PR = "7" 17PR = "7"
15 18
@@ -17,6 +20,7 @@ GARAGE_SIGN_PV = "0.6.0-3-gc38b9f3"
17 20
18SRC_URI = " \ 21SRC_URI = " \
19 gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ 22 gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \
23 file://run-ptest \
20 file://aktualizr.service \ 24 file://aktualizr.service \
21 file://aktualizr-secondary.service \ 25 file://aktualizr-secondary.service \
22 file://aktualizr-secondary.socket \ 26 file://aktualizr-secondary.socket \
@@ -28,18 +32,22 @@ SRC_URI = " \
28SRC_URI[md5sum] = "30d7f0931e2236954679e75d1bae174f" 32SRC_URI[md5sum] = "30d7f0931e2236954679e75d1bae174f"
29SRC_URI[sha256sum] = "46d8c6448ce14cbb9af6a93eba7e29d38579e566dcd6518d22f723a8da16cad5" 33SRC_URI[sha256sum] = "46d8c6448ce14cbb9af6a93eba7e29d38579e566dcd6518d22f723a8da16cad5"
30 34
31SRCREV = "ea03a5cf57def6b8d368f783cb12b91255365a80" 35SRCREV = "2e3ccbbdd43fdf70eb815454ea64f0bd8085856c"
32BRANCH ?= "master" 36BRANCH ?= "master"
33 37
34S = "${WORKDIR}/git" 38S = "${WORKDIR}/git"
35 39
36inherit pkgconfig cmake systemd 40inherit cmake pkgconfig ptest systemd
41
42# disable ptest by default as it slows down builds quite a lot
43# can be enabled manually by setting 'PTEST_ENABLED_pn-aktualizr' to '1' in local.conf
44PTEST_ENABLED = "0"
37 45
38SYSTEMD_PACKAGES = "${PN} ${PN}-secondary" 46SYSTEMD_PACKAGES = "${PN} ${PN}-secondary"
39SYSTEMD_SERVICE_${PN} = "aktualizr.service" 47SYSTEMD_SERVICE_${PN} = "aktualizr.service"
40SYSTEMD_SERVICE_${PN}-secondary = "aktualizr-secondary.socket" 48SYSTEMD_SERVICE_${PN}-secondary = "aktualizr-secondary.socket"
41 49
42EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV}" 50EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV} ${@bb.utils.contains('PTEST_ENABLED', '1', '-DTESTSUITE_VALGRIND=on', '', d)}"
43 51
44GARAGE_SIGN_OPS = "${@ d.expand('-DGARAGE_SIGN_ARCHIVE=${WORKDIR}/cli-${GARAGE_SIGN_PV}.tgz') if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''}" 52GARAGE_SIGN_OPS = "${@ d.expand('-DGARAGE_SIGN_ARCHIVE=${WORKDIR}/cli-${GARAGE_SIGN_PV}.tgz') if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''}"
45 53
@@ -54,6 +62,26 @@ PACKAGECONFIG[load-tests] = "-DBUILD_LOAD_TESTS=ON,-DBUILD_LOAD_TESTS=OFF,"
54PACKAGECONFIG[serialcan] = ",,,slcand-start" 62PACKAGECONFIG[serialcan] = ",,,slcand-start"
55PACKAGECONFIG[ubootenv] = ",,,u-boot-fw-utils aktualizr-uboot-env-rollback" 63PACKAGECONFIG[ubootenv] = ",,,u-boot-fw-utils aktualizr-uboot-env-rollback"
56 64
65do_compile_ptest() {
66 cmake_runcmake_build --target build_tests
67}
68
69do_install_ptest() {
70 # copy the complete source directory (contains build)
71 cp -r ${B}/ ${D}/${PTEST_PATH}/build
72 cp -r ${S}/ ${D}/${PTEST_PATH}/src
73
74 # remove huge external unused repository
75 rm -rf ${D}/${PTEST_PATH}/src/partial/extern/RIOT
76
77 # remove huge build artifacts
78 find ${D}/${PTEST_PATH}/build/src -name "*.a" -delete
79
80 # fix the absolute paths
81 find ${D}/${PTEST_PATH}/build -name "CMakeFiles" | xargs rm -rf
82 find ${D}/${PTEST_PATH}/build -name "*.cmake" -or -name "DartConfiguration.tcl" -or -name "run-valgrind" | xargs sed -e "s|${S}|${PTEST_PATH}/src|g" -e "s|${B}|${PTEST_PATH}/build|g" -e "s|\"--gtest_output[^\"]*\"||g" -i
83}
84
57do_install_append () { 85do_install_append () {
58 install -d ${D}${libdir}/sota 86 install -d ${D}${libdir}/sota
59 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml 87 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml
diff --git a/recipes-sota/aktualizr/files/run-ptest b/recipes-sota/aktualizr/files/run-ptest
new file mode 100755
index 0000000..e5f0d56
--- /dev/null
+++ b/recipes-sota/aktualizr/files/run-ptest
@@ -0,0 +1,16 @@
1#!/bin/sh
2
3set -e
4
5filter_logs() {
6 awk '/^.*Test[[:space:]]*#[[:digit:]]+:/ {
7 a = gensub(/^.*Test[[:space:]]*#[[:digit:]]+:[[:space:]]*([^[:space:]]+).*(Passed|Skipped|Not Run|Failed|Timeout|Exception)[[:space:]:].*$/, "\\2: \\1", "g");
8 a = gensub(/^Passed/, "PASS", "g", a);
9 a = gensub(/^(Skipped|Disabled)/, "SKIP", "g", a);
10 a = gensub(/^(Not Run|Failed|Timeout|Exception)/, "FAIL", "g", a);
11 print a;
12 }'
13}
14
15cd build
16ctest -j 8 -O /tmp/aktualizr-ptest.log --output-on-failure -LE 'noptest' 2> /dev/null | filter_logs