diff options
| author | Gyorgy Sarvari <skandigraun@gmail.com> | 2025-10-21 10:48:07 +0200 |
|---|---|---|
| committer | Gyorgy Sarvari <skandigraun@gmail.com> | 2025-10-27 11:17:05 +0100 |
| commit | 0a01ebf675f774d7c6504289571f4f0d2d8cb8ac (patch) | |
| tree | 0352dd01a9f61ce91fb19ba185e2e68177040d25 | |
| parent | a78b82d8dbe520822c490b16181f4034a232f858 (diff) | |
| download | meta-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-ptest | 139 | ||||
| -rw-r--r-- | meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb | 10 |
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 | |||
| 5 | report_result(){ | ||
| 6 | if [ $1 -eq 0 ]; then | ||
| 7 | echo PASS: $2 | ||
| 8 | else | ||
| 9 | echo FAIL: $2 | ||
| 10 | fi | ||
| 11 | } | ||
| 12 | |||
| 13 | report_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 | ||
| 23 | report_result $? empty | ||
| 24 | |||
| 25 | # check version info in zck | ||
| 26 | zck -V | ||
| 27 | report_result $? "zck version" | ||
| 28 | |||
| 29 | # check version info of unzck | ||
| 30 | unzck -V | ||
| 31 | report_result $? "unzck version" | ||
| 32 | |||
| 33 | # check version of zckdl | ||
| 34 | zckdl -V | ||
| 35 | report_result $? "zckdl version" | ||
| 36 | |||
| 37 | # check version of zck_read_header | ||
| 38 | zck_read_header -V | ||
| 39 | report_result $? "zck_read_header version" | ||
| 40 | |||
| 41 | # check version of zck_delta_size | ||
| 42 | zck_delta_size -V | ||
| 43 | report_result $? "zck_delta_size version" | ||
| 44 | |||
| 45 | # check opening file with optional flags | ||
| 46 | ./tests/optelems ./tests/files/empty.optelems.zck | ||
| 47 | report_result $? "check opening file with optional flags" | ||
| 48 | |||
| 49 | # checksum with non-hex character | ||
| 50 | ./tests/invalid_input_checksum ./tests/files/empty.optelems.zck | ||
| 51 | report_result $? "checksum with non-hex character" | ||
| 52 | |||
| 53 | # read single chunk | ||
| 54 | ./tests/read_single_chunk ./tests/files/LICENSE.dict.fodt.zck | ||
| 55 | report_result $? "read single chunk" | ||
| 56 | |||
| 57 | # read single compressed chunk | ||
| 58 | ./tests/read_single_comp_chunk ./tests/files/LICENSE.dict.fodt.zck | ||
| 59 | report_result $? "read single compressed chunk" | ||
| 60 | |||
| 61 | # check verbosity in unzck | ||
| 62 | unzck -vvvvv ./empty.zck | ||
| 63 | report_result $? "check verbosity in unzck" | ||
| 64 | |||
| 65 | # check verbosity in zck | ||
| 66 | zck -vvvvv ./empty | ||
| 67 | report_result $? "check verbosity in zck" | ||
| 68 | |||
| 69 | # check verbosity in zckdl | ||
| 70 | zckdl -vvvvv file:///empty | ||
| 71 | report_result_expected_fail $? "check verbosity in zckdl" | ||
| 72 | |||
| 73 | # check verbosity in zck_read_header | ||
| 74 | zck_read_header -vvvvvfc ./empty.zck | ||
| 75 | report_result $? "check verbosity in zck_read_header" | ||
| 76 | |||
| 77 | # check verbosity in zck_delta_size | ||
| 78 | zck_delta_size -vvvvv ./empty.zck ./empty.zck | ||
| 79 | report_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 | ||
| 83 | report_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 | ||
| 87 | report_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 | ||
| 91 | report_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 | ||
| 95 | report_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 | ||
| 99 | report_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 | ||
| 103 | report_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 | ||
| 107 | report_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 | ||
| 111 | report_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 | ||
| 115 | report_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 | ||
| 119 | report_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 | ||
| 123 | report_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 | ||
| 127 | report_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 | ||
| 131 | report_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 | ||
| 135 | report_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 | ||
| 139 | report_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 | ||
| 7 | SRC_URI = "git://github.com/zchunk/zchunk.git;protocol=https;branch=main \ | 7 | SRC_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 | ||
| 11 | SRCREV = "dd6a30a1e4e8b738b0cafc682f3c00e7706134e5" | 12 | SRCREV = "dd6a30a1e4e8b738b0cafc682f3c00e7706134e5" |
| @@ -19,6 +20,13 @@ DEPENDS = "\ | |||
| 19 | DEPENDS:append:libc-musl = " argp-standalone" | 20 | DEPENDS:append:libc-musl = " argp-standalone" |
| 20 | LDFLAGS:append:libc-musl = " -largp" | 21 | LDFLAGS:append:libc-musl = " -largp" |
| 21 | 22 | ||
| 22 | inherit meson pkgconfig | 23 | inherit meson pkgconfig ptest |
| 24 | |||
| 25 | do_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 | ||
| 24 | BBCLASSEXTEND = "native nativesdk" | 31 | BBCLASSEXTEND = "native nativesdk" |
| 32 | |||
