Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
clamav: fix unit test race condition
- fixed.

Wenn die unit tests laufen, versucht
   `clamav-0.104.2-0/source/unit_tests/input/xor_testfile.py`
den Folder `"build/unit_tests/input/clamav_hdb_scanfiles"` zu erstellen, der aber schon existiert.

im xor_testfile.py:55 wir erst ein mkdir(), dann ein open/write/close gemacht, innerhalb eines try:-blocks

```
[  0%] Decrypting test file clam-v3.rar...
cd PREFIX/buildroot/clamav/clamav-0.104.2-0/build/unit_tests/input && /usr/local/package/bin/python3.8 PREFIX/buildroot/clamav/clamav-0.104.2-0/source/unit_tests/input/xor_testfile.py --in_file PREFIX/buildroot/clamav/clamav-0.104.2-0/source/unit_tests/input/clamav_hdb_scanfiles/clam-v3.rar.xor --out_file PREFIX/buildroot/clamav/clamav-0.104.2-0/build/unit_tests/input/clamav_hdb_scanfiles/clam-v3.rar

Failed to create file: PREFIX/buildroot/clamav/clamav-0.104.2-0/build/unit_tests/input/clamav_hdb_scanfiles/clam-v3.rar. Exception: [Errno 17] File exists: 'PREFIX/buildroot/clamav/clamav-0.104.2-0/build/unit_tests/input/clamav_hdb_scanfiles'

make[2]: *** [unit_tests/input/CMakeFiles/tgt_clam-v3.rar.dir/build.make:64: unit_tests/input/clamav_hdb_scanfiles/clam-v3.rar] Error 1
make[2]: Leaving directory 'PREFIX/buildroot/clamav/clamav-0.104.2-0/build'
make[2]: Entering directory 'PREFIX/buildroot/clamav/clamav-0.104.2-0/build'

versus

[  0%] Decrypting test file clam-v3.rar...
cd PREFIX/buildroot/clamav/clamav-0.104.2-0/build/unit_tests/input && /usr/bin/python3 PREFIX/buildroot/clamav/clamav-0.104.2-0/source/unit_tests/input/xor_testfile.py --in_file PREFIX/buildroot/clamav/clamav-0.104.2-0/source/unit_tests/input/clamav_hdb_scanfiles/clam-v3.rar.xor --out_file PREFIX/buildroot/clamav/clamav-0.104.2-0/build/unit_tests/input/clamav_hdb_scanfiles/clam-v3.rar
Created: 'PREFIX/buildroot/clamav/clamav-0.104.2-0/build/unit_tests/input/clamav_hdb_scanfiles/clam-v3.rar'
make[2]: Leaving directory 'PREFIX/buildroot/clamav/clamav-0.104.2-0/build'
make[1]: Entering directory 'PREFIX/buildroot/clamav/clamav-0.104.2-0/build'
[  1%] Built target tgt_clam_cache_emax.tgz
make[1]: Leaving directory 'PREFIX/buildroot/clamav/clamav-0.104.2-0/build'
make[1]: Entering directory 'PREFIX/buildroot/clamav/clamav-0.104.2-0/build'
[  2%] Built target tgt_clam-v3.rar
```
  • Loading branch information
wwwutz committed Apr 13, 2022
1 parent b7ef052 commit 71a898f
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions clamav.be0
@@ -1,18 +1,18 @@
#!/usr/bin/env beesh

# BEE_VERSION clamav-0.104.2-0
# BEE_VERSION clamav-0.104.2-1

# SRCURL[0]="https://www.clamav.net/downloads/production/clamav-${PKGVERSION}.tar.gz"
SRCURL[0]="https://beehive.molgen.mpg.de/ad099675f2c09c07850e36496b06c552/clamav-0.104.2.tar.gz"

# PATCHURL+=()
PATCHURL+=("https://beehive.molgen.mpg.de/96618bb8d05ae1995275837564c7c2c6/clamav-01042-fix-test-race.patch")

# build_in_sourcedir

# sourcesubdir_append src

#mee_extract() {
# bee_extract "${@}"
# bee_extract "${@}"q
#}

#mee_patch() {
Expand All @@ -21,14 +21,15 @@ SRCURL[0]="https://beehive.molgen.mpg.de/ad099675f2c09c07850e36496b06c552/clamav

mee_configure() {
bee_configure \
-D ENABLE_MILTER=OFF \
-D APP_CONFIG_DIRECTORY=/etc
-D ENABLE_MILTER=OFF \
-D APP_CONFIG_DIRECTORY=/etc
}

#mee_build() {
# bee_build
#}

#mee_install() {
# bee_install
#}
mee_install() {
bee_install
cd ${D} && rm -rvf usr/share/doc
}

0 comments on commit 71a898f

Please sign in to comment.