summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2025-10-21 10:48:07 +0200
committerGyorgy Sarvari <skandigraun@gmail.com>2025-10-27 11:17:05 +0100
commit0a01ebf675f774d7c6504289571f4f0d2d8cb8ac (patch)
tree0352dd01a9f61ce91fb19ba185e2e68177040d25
parenta78b82d8dbe520822c490b16181f4034a232f858 (diff)
downloadmeta-openembedded-0a01ebf675f774d7c6504289571f4f0d2d8cb8ac.tar.gz
zchunk: add ptest support
It takes under 5 seconds to execute. The script is a shell conversion from the meson tests. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
-rw-r--r--meta-oe/recipes-support/zchunk/zchunk/run-ptest139
-rw-r--r--meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb10
2 files changed, 148 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/zchunk/zchunk/run-ptest b/meta-oe/recipes-support/zchunk/zchunk/run-ptest
new file mode 100644
index 0000000000..d4b1439905
--- /dev/null
+++ b/meta-oe/recipes-support/zchunk/zchunk/run-ptest
@@ -0,0 +1,139 @@
1#!/bin/sh
2
3# this is a shell-rewrite of meson tests, from test/meson.build file
4
5report_result(){
6 if [ $1 -eq 0 ]; then
7 echo PASS: $2
8 else
9 echo FAIL: $2
10 fi
11}
12
13report_result_expected_fail(){
14 if [ $? -eq 0 ]; then
15 echo FAIL: $2
16 else
17 echo PASS: $2
18 fi
19}
20
21# create and validate empty zchunk file
22./tests/empty
23report_result $? empty
24
25# check version info in zck
26zck -V
27report_result $? "zck version"
28
29# check version info of unzck
30unzck -V
31report_result $? "unzck version"
32
33# check version of zckdl
34zckdl -V
35report_result $? "zckdl version"
36
37# check version of zck_read_header
38zck_read_header -V
39report_result $? "zck_read_header version"
40
41# check version of zck_delta_size
42zck_delta_size -V
43report_result $? "zck_delta_size version"
44
45# check opening file with optional flags
46./tests/optelems ./tests/files/empty.optelems.zck
47report_result $? "check opening file with optional flags"
48
49# checksum with non-hex character
50./tests/invalid_input_checksum ./tests/files/empty.optelems.zck
51report_result $? "checksum with non-hex character"
52
53# read single chunk
54./tests/read_single_chunk ./tests/files/LICENSE.dict.fodt.zck
55report_result $? "read single chunk"
56
57# read single compressed chunk
58./tests/read_single_comp_chunk ./tests/files/LICENSE.dict.fodt.zck
59report_result $? "read single compressed chunk"
60
61# check verbosity in unzck
62unzck -vvvvv ./empty.zck
63report_result $? "check verbosity in unzck"
64
65# check verbosity in zck
66zck -vvvvv ./empty
67report_result $? "check verbosity in zck"
68
69# check verbosity in zckdl
70zckdl -vvvvv file:///empty
71report_result_expected_fail $? "check verbosity in zckdl"
72
73# check verbosity in zck_read_header
74zck_read_header -vvvvvfc ./empty.zck
75report_result $? "check verbosity in zck_read_header"
76
77# check verbosity in zck_delta_size
78zck_delta_size -vvvvv ./empty.zck ./empty.zck
79report_result $? "check verbosity in zck_delta_size"
80
81# copy chunks from source
82./tests/copy_chunks ./tests/files/LICENSE.header.new.nodict.fodt.zck ./tests/files/LICENSE.nodict.fodt.zck
83report_result $? "copy chunks from source"
84
85# decompress previously generated auto-chunked file - nocomp
86./tests/shacheck `which unzck` LICENSE.nocomp.fodt 394ed6c2fc4ac47e5ee111a46f2a35b8010a56c7747748216f52105e868d5a3e ./tests/files/LICENSE.nocomp.fodt.zck
87report_result $? "decompress previously generated auto-chunked file - nocomp"
88
89# decompress previously generated auto-chunked file - no dict
90./tests/shacheck `which unzck` LICENSE.nodict.fodt 394ed6c2fc4ac47e5ee111a46f2a35b8010a56c7747748216f52105e868d5a3e ./tests/files/LICENSE.nodict.fodt.zck
91report_result $? "decompress previously generated auto-chunked file - no dict"
92
93# decompress previously generated auto-chunked file - dict
94./tests/shacheck `which unzck` LICENSE.dict.fodt 394ed6c2fc4ac47e5ee111a46f2a35b8010a56c7747748216f52105e868d5a3e ./tests/files/LICENSE.dict.fodt.zck
95report_result $? "decompress previously generated auto-chunked file - dict"
96
97# decompress previously generated manual file - no dict
98./tests/shacheck `which unzck` LICENSE.manual.nodict.fodt 394ed6c2fc4ac47e5ee111a46f2a35b8010a56c7747748216f52105e868d5a3e ./tests/files/LICENSE.manual.nodict.fodt.zck
99report_result $? "decompress previously generated manual file - no dict"
100
101# decompress previously generated manual file - dict
102./tests/shacheck `which unzck` LICENSE.manual.dict.fodt 394ed6c2fc4ac47e5ee111a46f2a35b8010a56c7747748216f52105e868d5a3e ./tests/files/LICENSE.manual.dict.fodt.zck
103report_result $? "decompress previously generated manual file - dict"
104
105# decompress dict from previously generated auto-chunked file
106./tests/shacheck `which unzck` LICENSE.dict.fodt.zdict b20064d89c3beb8605d99c994ff45304f308abd840c0981475dd2faca6ec854b --dict ./tests/files/LICENSE.dict.fodt.zck
107report_result $? "decompress dict from previously generated auto-chunked file"
108
109# compress auto-chunked file - no dict
110./tests/shacheck `which zck` LICENSE.nodict.fodt.zck ac9d431f1f568d8921257fa17929c320f0cdcbff450d9f3c38c78c4f410ee788 -o LICENSE.nodict.fodt.zck ./tests/files/LICENSE.fodt
111report_result $? "compress auto-chunked file - no dict'"
112
113# decompress auto-chunked file - no dict
114./tests/shacheck `which unzck` LICENSE.nodict.fodt 394ed6c2fc4ac47e5ee111a46f2a35b8010a56c7747748216f52105e868d5a3e LICENSE.nodict.fodt.zck
115report_result $? "decompress auto-chunked file - no dict"
116
117# compress auto-chunked file - dict
118./tests/shacheck `which zck` LICENSE.dict.fodt.zck 35549b28b01c0a43d7389d4c40d5b750c73fb6c0c6701355ef709ef4a37df389 -D ./tests/files/LICENSE.dict -o LICENSE.dict.fodt.zck ./tests/files/LICENSE.fodt
119report_result $? "compress auto-chunked file - dict"
120
121# decompress auto-chunked file - dict
122./tests/shacheck `which unzck` LICENSE.dict.fodt 394ed6c2fc4ac47e5ee111a46f2a35b8010a56c7747748216f52105e868d5a3e LICENSE.dict.fodt.zck
123report_result $? "decompress auto-chunked file - dict"
124
125# compress manual file - no dict
126./tests/shacheck `which zck` LICENSE.manual.nodict.fodt.zck 2580f66412adce1ed8d92abc09b0f64eb155155f61e21a8269a2c4a338857e51 -m -s "<text:" -o LICENSE.manual.nodict.fodt.zck ./tests/files/LICENSE.fodt
127report_result $? "compress manual file - no dict"
128
129# decompress manual file - no dict
130./tests/shacheck `which unzck` LICENSE.manual.nodict.fodt 394ed6c2fc4ac47e5ee111a46f2a35b8010a56c7747748216f52105e868d5a3e LICENSE.manual.nodict.fodt.zck
131report_result $? "decompress manual file - no dict"
132
133# compress manual file - dict
134./tests/shacheck `which zck` LICENSE.manual.dict.fodt.zck 863dc2bda721a32c26485eeb2223d5dabcf9ac517ecba8c7991fa0120d04c937 -D ./tests/files/LICENSE.dict -m -s "<text:" -o LICENSE.manual.dict.fodt.zck ./tests/files/LICENSE.fodt
135report_result $? "compress manual file - dict"
136
137# decompress manual file - dict
138./tests/shacheck `which unzck` LICENSE.manual.dict.fodt 394ed6c2fc4ac47e5ee111a46f2a35b8010a56c7747748216f52105e868d5a3e LICENSE.manual.dict.fodt.zck
139report_result $? "decompress manual file - dict"
diff --git a/meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb b/meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb
index 5eb2741b1f..ce71fcfb8b 100644
--- a/meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb
+++ b/meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb
@@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=daf6e68539f564601a5a5869c31e5242"
6 6
7SRC_URI = "git://github.com/zchunk/zchunk.git;protocol=https;branch=main \ 7SRC_URI = "git://github.com/zchunk/zchunk.git;protocol=https;branch=main \
8 file://0001-Handle-overflow-errors-in-malformed-zchunk-files.patch \ 8 file://0001-Handle-overflow-errors-in-malformed-zchunk-files.patch \
9 file://run-ptest \
9 " 10 "
10 11
11SRCREV = "dd6a30a1e4e8b738b0cafc682f3c00e7706134e5" 12SRCREV = "dd6a30a1e4e8b738b0cafc682f3c00e7706134e5"
@@ -19,6 +20,13 @@ DEPENDS = "\
19DEPENDS:append:libc-musl = " argp-standalone" 20DEPENDS:append:libc-musl = " argp-standalone"
20LDFLAGS:append:libc-musl = " -largp" 21LDFLAGS:append:libc-musl = " -largp"
21 22
22inherit meson pkgconfig 23inherit meson pkgconfig ptest
24
25do_install_ptest(){
26 install -d ${D}${PTEST_PATH}/tests
27 find ${B}/test -maxdepth 1 -type f -exec install {} ${D}${PTEST_PATH}/tests/ \;
28 cp -r ${S}/test/files ${D}${PTEST_PATH}/tests/
29}
23 30
24BBCLASSEXTEND = "native nativesdk" 31BBCLASSEXTEND = "native nativesdk"
32