Libelektra: Las pruebas se comportan de forma extraña en determinados entornos (paquetes debian)

Creado en 11 may. 2018  ·  35Comentarios  ·  Fuente: ElektraInitiative/libelektra

Antes de bc804c207df391c339d880d3487ea3c16eb4ee4e, las siguientes pruebas fallaban en algunos entornos al compilar paquetes Debian:

  • testmod_blockresolver
  • testmod_crypto_openssl
  • testmod_crypto_gcrypt
  • testmod_crypto_botan
  • testmod_fcrypt

EDITAR markus: También puede reproducir los problemas de blockresolver y fcrypt manipulando HOME y TMPDIR. No se necesita la construcción de un paquete.

registros de errores

resolver bloque

[package/stretch]  42/118 Test  #48: testmod_blockresolver ............***Failed    0.00 sec
[package/stretch] BLOCKRESOLVER     TESTS
[package/stretch] ==================
[package/stretch] 
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/blockresolver/testmod_blockresolver.c:70: error in test_BlockresolverWrite: blockresolver->kdbSet failed
[package/stretch] Compare <key = only the inside has changed
[package/stretch] >, with <key = inside block
[package/stretch] >
[package/stretch] in file /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/blockresolver/blockresolver/compare.block, line 5.
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/tests/cframework/tests.c:157: error in compare_line_files: comparing lines failed
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/blockresolver/testmod_blockresolver.c:72: error in test_BlockresolverWrite: files do not match as expected
[package/stretch] 
[package/stretch] testmod_blockresolver Results: 15 Tests done — 3 errors.

crypto_openssl

[package/stretch]  48/118 Test  #60: testmod_crypto_openssl ...........***Failed    5.32 sec
[package/stretch] CYPTO        TESTS
[package/stretch] ==================
[package/stretch] 
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/crypto/test_internals.h:263: error in test_gpg: failed to install the GPG test key
[package/stretch] 
[package/stretch] crypto_openssl Results: 65 Tests done — 1 error.

crypto_gcrypt

[package/stretch]  49/118 Test  #61: testmod_crypto_gcrypt ............***Failed    5.18 sec
[package/stretch] CYPTO        TESTS
[package/stretch] ==================
[package/stretch] 
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/crypto/test_internals.h:263: error in test_gpg: failed to install the GPG test key

crypto_botan

[package/stretch]  50/118 Test  #62: testmod_crypto_botan .............***Failed    5.41 sec
[package/stretch] CYPTO        TESTS
[package/stretch] ==================
[package/stretch] 
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/crypto/test_internals.h:263: error in test_gpg: failed to install the GPG test key

fcrypt

[package/stretch]  57/118 Test  #73: testmod_fcrypt ...................***Failed   15.03 sec
[package/stretch] FCRYPT       TESTS
[package/stretch] ==================
[package/stretch] 
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/fcrypt/testmod_fcrypt.c:159: error in test_gpg: failed to install the GPG test key
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/fcrypt/testmod_fcrypt.c:187: error in test_file_crypto_operations: kdb set failed
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/fcrypt/testmod_fcrypt.c:188: error in test_file_crypto_operations: file content did not change during encryption
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/fcrypt/testmod_fcrypt.c:191: error in test_file_crypto_operations: kdb get (pregetstorage) failed
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/fcrypt/testmod_fcrypt.c:195: error in test_file_crypto_operations: kdb get (postgetstorage) failed
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/fcrypt/testmod_fcrypt.c:196: error in test_file_crypto_operations: postgetstorage did not encrypt the file again
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/fcrypt/testmod_fcrypt.c:231: error in test_file_signature_operations: kdb set failed
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/fcrypt/testmod_fcrypt.c:232: error in test_file_signature_operations: file content did not change during encryption
[package/stretch] /home/jenkins/workspace/elektra-jenkinsfile/libelektra/src/plugins/fcrypt/testmod_fcrypt.c:235: error in test_file_signature_operations: kdb get failed
[package/stretch] 

discusión

En # 1965 tuvimos algunas discusiones sobre la búsqueda de errores que finalmente apuntaban a https://github.com/ElektraInitiative/libelektra/commit/356317a6ab811f524ebaa1dbf40f19477b966fc1 como la confirmación que hizo que aparecieran los errores. Sin embargo, limpiar el medio ambiente no debería tener el efecto secundario de hacer pasar las pruebas.
Si las pruebas necesitan ciertas configuraciones ambientales, deben establecerlas.

bug

Comentario más útil

@ petermax2 el Vagrantfile y los pasos para reproducir están en # 2211. Espero que esto ayude a depurar el problema más fácilmente. Tal vez sea solo un problema de ENV.

Todos 35 comentarios

¡Gracias por informarlo por separado!

Como efecto secundario https://build.libelektra.org/jenkins/job/elektra-git-buildpackage-jessie/ parece estar funcionando de nuevo desde ayer ...

GPG parece tener un problema con el entorno despejado. Experimentaré configurando la variable GNUPGHOME en /tmp . GPG se basa en este directorio (el predeterminado es ~/.gnupg/ ) para buscar su cadena de claves. Creo que la información gpg-agent también se almacena en este directorio. Configurarlo en el mismo directorio para todas las pruebas también podría corregir el error de aparición de varios gpg-agents para cada ejecución de prueba (ver # 1928).

Sí, también pensé que los casos de prueba de cifrado fallidos están relacionados con # 1928. Parece que gpg usa .gnupg debajo del TMPDIR. (Al menos verá un .gnupg sobrante después de ejecutar TMPDIR=`pwd`/x ctest --output-on-failure -R fcrypt ).

Los casos de prueba de fcrypt fallidos pueden mostrar un error en el manejo de archivos temporales, también relacionados con TMPDIR.

parece que gpg usa .gnupg debajo del TMPDIR

esta es una suposición incorrecta. gpg usa ~ / .gnupg por defecto, por lo que no está relacionado con TMPDIR sino con HOME.

Tenga en cuenta también que configurar GNUPGHOME en el mismo directorio para todas las pruebas puede influir en la ejecución de la prueba en paralelo.

esta es una suposición incorrecta

¿A qué suposición te refieres? Solo me refería a que obtengo una carpeta .gnupg dentro de TMPDIR.

mkdir x && env TMPDIR=`pwd`/x ctest --output-on-failure -R fcrypt; find x
Test project /home/markus/Projekte/Elektra/build
    Start 64: testmod_fcrypt
1/1 Test #64: testmod_fcrypt ...................***Failed    0.02 sec
FCRYPT       TESTS
==================

/home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:187: error in test_file_crypto_operations: kdb set failed
/home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:188: error in test_file_crypto_operations: file content did not change during encryption
/home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:191: error in test_file_crypto_operations: kdb get (pregetstorage) failed
/home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:195: error in test_file_crypto_operations: kdb get (postgetstorage) failed
/home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:196: error in test_file_crypto_operations: postgetstorage did not encrypt the file again
/home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:231: error in test_file_signature_operations: kdb set failed
/home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:232: error in test_file_signature_operations: file content did not change during encryption
/home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:235: error in test_file_signature_operations: kdb get failed

fcrypt Results: 39 Tests done — 8 errors.


0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.03 sec

The following tests FAILED:
         64 - testmod_fcrypt (Failed)
Errors while running CTest
x
x/elektra-test.qPoz5P
x/elektra-test.qPoz5P/.gnupg
x/elektra-test.qPoz5P/.gnupg/random_seed
x/elektra-test.qPoz5P/.gnupg/trustdb.gpg
x/elektra-test.qPoz5P/.gnupg/pubring.kbx~
x/elektra-test.qPoz5P/.gnupg/pubring.kbx

eso se debe a que algo en las pruebas (ctest?) establece el directorio de inicio de cada suite de pruebas en un tmpdir en TMPDIR.
GPG crea los archivos en HOME, pero HOME está configurado en TMPDIR / randomdir / por el testinguite.
Por lo tanto, mi punto es que no es la única culpa de tmpdir y el esfuerzo de depuración no debe limitarse a él.

Creo que es una buena idea tener directorios de inicio separados para cada prueba para que no se influyan entre sí (paralelización) y, por lo tanto, no creo que anular los directorios gpg para compartir un solo directorio sea una buena idea.

Sí estoy de acuerdo.

¿Tiene sentido # 1977? ¿O debería hacerse después de que ctest terminado por completo?

O preguntado de otra manera: ¿el agente gpg sobrevive a una ejecución de un solo conjunto de pruebas o reaparecen para cada conjunto de pruebas?

@ markus2330 Como se menciona en # 2040. Seguí las instrucciones para crear las imágenes de Docker. Dentro del contenedor de la ventana acoplable ejecuté:

# cmake -DBUILD_DOCUMENTATION=OFF -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..
# make -j16
# mkdir x
# TMPDIR=`pwd`/x ctest -R crypt .
Test project /elektra/build
    Start 46: testmod_crypto_openssl
1/3 Test #46: testmod_crypto_openssl ...........   Passed    1.32 sec
    Start 47: testmod_crypto_gcrypt
2/3 Test #47: testmod_crypto_gcrypt ............   Passed    1.16 sec
    Start 48: testmod_crypto_botan
3/3 Test #48: testmod_crypto_botan .............   Passed    1.52 sec

100% tests passed, 0 tests failed out of 3

Label Time Summary:
memleak    =   1.16 sec (1 test)

Total Test time (real) =   4.01 sec

Entonces (una parte del) problema es que los casos de prueba asumen que el TMPDIR está presente. Y no pudiste reproducirlo porque siempre creaste el directorio antes de ejecutar las pruebas: smile:

Pero, para mí, fcrypt falla, incluso cuando x está presente (no ejecutó fcrypt). Pero con otros mensajes:

64: FCRYPT       TESTS
64: ==================
64: 
64: /home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:187: error in test_file_crypto_operations: kdb set failed
64: /home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:188: error in test_file_crypto_operations: file content did not change during encryption
64: /home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:191: error in test_file_crypto_operations: kdb get (pregetstorage) failed
64: /home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:195: error in test_file_crypto_operations: kdb get (postgetstorage) failed
64: /home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:196: error in test_file_crypto_operations: postgetstorage did not encrypt the file again
64: /home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:231: error in test_file_signature_operations: kdb set failed
64: /home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:232: error in test_file_signature_operations: file content did not change during encryption
64: /home/markus/Projekte/Elektra/current/src/plugins/fcrypt/testmod_fcrypt.c:235: error in test_file_signature_operations: kdb get failed
64: 
64: fcrypt Results: 39 Tests done — 8 errors.
1/1 Test #64: testmod_fcrypt ...................***Failed    0.02 sec

Pero funciona en mi contenedor (he estado esperando mucho tiempo para dejar esa línea: riendo:) ...

jenkins<strong i="6">@924c627f07b8</strong>:/elektra/build$ ctest --output-on-failure -R fcrypt
Test project /elektra/build
    Start 59: testmod_fcrypt
1/1 Test #59: testmod_fcrypt ...................   Passed    1.07 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   1.08 sec
jenkins<strong i="7">@924c627f07b8</strong>:/elektra/build$ TMPDIR=`pwd`/x ctest --output-on-failure -R fcrypt
Test project /elektra/build
    Start 59: testmod_fcrypt
1/1 Test #59: testmod_fcrypt ...................***Failed    0.01 sec
FCRYPT       TESTS
==================

/elektra/tests/cframework/tests.c:80: error in init: mkdtemp failed
/elektra/tests/cframework/tests.c:90: error in init: mkstemp failed
/elektra/src/plugins/fcrypt/testmod_fcrypt.c:159: error in test_gpg: failed to install the GPG test key
/elektra/src/plugins/fcrypt/testmod_fcrypt.c:71: error in writeTestFile: can not write to temporary file
/elektra/src/plugins/fcrypt/testmod_fcrypt.c:187: error in test_file_crypto_operations: kdb set failed
/elektra/src/plugins/fcrypt/testmod_fcrypt.c:99: error in isTestFileCorrect: can not read from temporary file
/elektra/src/plugins/fcrypt/testmod_fcrypt.c:191: error in test_file_crypto_operations: kdb get (pregetstorage) failed
/elektra/src/plugins/fcrypt/testmod_fcrypt.c:99: error in isTestFileCorrect: can not read from temporary file
/elektra/src/plugins/fcrypt/testmod_fcrypt.c:192: error in test_file_crypto_operations: file content could not be restored during decryption
/elektra/src/plugins/fcrypt/testmod_fcrypt.c:195: error in test_file_crypto_operations: kdb get (postgetstorage) failed
/elektra/src/plugins/fcrypt/testmod_fcrypt.c:99: error in isTestFileCorrect: can not read from temporary file
/elektra/src/plugins/fcrypt/testmod_fcrypt.c:71: error in writeTestFile: can not write to temporary file
/elektra/src/plugins/fcrypt/testmod_fcrypt.c:231: error in test_file_signature_operations: kdb set failed
/elektra/src/plugins/fcrypt/testmod_fcrypt.c:99: error in isTestFileCorrect: can not read from temporary file
/elektra/src/plugins/fcrypt/testmod_fcrypt.c:235: error in test_file_signature_operations: kdb get failed
/elektra/src/plugins/fcrypt/testmod_fcrypt.c:80: error in writeFaultySignatureFile: can not write to temporary file

fcrypt Results: 32 Tests done — 16 errors.


0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.02 sec

The following tests FAILED:
        59 - testmod_fcrypt (Failed)
Errors while running CTest
jenkins<strong i="8">@924c627f07b8</strong>:/elektra/build$ mkdir x
jenkins<strong i="9">@924c627f07b8</strong>:/elektra/build$ TMPDIR=`pwd`/x ctest --output-on-failure -R fcrypt
Test project /elektra/build
    Start 59: testmod_fcrypt
1/1 Test #59: testmod_fcrypt ...................   Passed    1.06 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   1.07 sec
jenkins<strong i="10">@924c627f07b8</strong>:/elektra/build$

algunas cosas más interesantes:

  • ¿Por qué falla mkdtemp?
  • clean_temp_home aparentemente ya se ha escrito para limpiar cosas de gnupg. ¿Por qué no funciona?

    • parece que los nombres cambiaron

  • incluso cuando existe el directorio en TMPDIR, tengo fcrypt fallando (las otras pruebas pasan)

    • cuando no se especifican pases TMPDIR fcrypt

bueno ... revisa las advertencias para las pruebas.cy todo se vuelve mucho más claro ...

Sin embargo, estoy preparando un PR, lo que debería resolver algunos de los problemas.

Si alguien pudiera averiguar si fcrypt tiene algunas rutas difíciles especificadas en algún lugar que podrían llevar a que las pruebas fallen, sería maravilloso.

En el n. ° 2056 limpio correctamente el TMPDIR generado. Esto resuelve el problema persistente de gpg-agent.
También soluciona un problema con las versiones más recientes de glibc que no activaban mkdtemp.

Sin embargo, la prueba fcrypt aún falla tan pronto como TMPDIR se configura manualmente y creo que podría haber un error real en el código en alguna parte.

jenkins<strong i="8">@0585a86e6f5f</strong>:~/workspace/build$ pidof gpg-agent
jenkins<strong i="9">@0585a86e6f5f</strong>:~/workspace/build$ TMPDIR=`pwd`/tmp ctest --output-on-failure -R crypt
Test project /home/jenkins/workspace/build
    Start 51: testmod_crypto_openssl
1/4 Test #51: testmod_crypto_openssl ...........   Passed    1.58 sec
    Start 52: testmod_crypto_gcrypt
2/4 Test #52: testmod_crypto_gcrypt ............   Passed    1.34 sec
    Start 53: testmod_crypto_botan
3/4 Test #53: testmod_crypto_botan .............   Passed    1.83 sec
    Start 64: testmod_fcrypt
4/4 Test #64: testmod_fcrypt ...................***Failed    1.17 sec
FCRYPT       TESTS
==================

/home/jenkins/workspace/src/plugins/fcrypt/testmod_fcrypt.c:187: error in test_file_crypto_operations: kdb set failed
/home/jenkins/workspace/src/plugins/fcrypt/testmod_fcrypt.c:188: error in test_file_crypto_operations: file content did not change during encryption
/home/jenkins/workspace/src/plugins/fcrypt/testmod_fcrypt.c:191: error in test_file_crypto_operations: kdb get (pregetstorage) failed
/home/jenkins/workspace/src/plugins/fcrypt/testmod_fcrypt.c:195: error in test_file_crypto_operations: kdb get (postgetstorage) failed
/home/jenkins/workspace/src/plugins/fcrypt/testmod_fcrypt.c:196: error in test_file_crypto_operations: postgetstorage did not encrypt the file again
/home/jenkins/workspace/src/plugins/fcrypt/testmod_fcrypt.c:231: error in test_file_signature_operations: kdb set failed
/home/jenkins/workspace/src/plugins/fcrypt/testmod_fcrypt.c:232: error in test_file_signature_operations: file content did not change during encryption
/home/jenkins/workspace/src/plugins/fcrypt/testmod_fcrypt.c:235: error in test_file_signature_operations: kdb get failed

fcrypt Results: 39 Tests done — 8 errors.


75% tests passed, 1 tests failed out of 4

Label Time Summary:
memleak    =   1.34 sec (1 test)

Total Test time (real) =   5.98 sec

The following tests FAILED:
     64 - testmod_fcrypt (Failed)
Errors while running CTest
jenkins<strong i="10">@0585a86e6f5f</strong>:~/workspace/build$ pidof gpg-agent
jenkins<strong i="11">@0585a86e6f5f</strong>:~/workspace/build$ ls -l tmp
total 0

Sin embargo, la prueba fcrypt aún falla tan pronto como TMPDIR se configura manualmente y creo que podría haber un error real en el código en alguna parte.

¡Tienes razón!

getTemporaryFileName en fcrypt.c no comprueba el entorno. Entonces, si no se especifica tmpdir en la configuración del complemento, usa /tmp como respaldo predeterminado.

Supongo que la priorización correcta sería:

  1. complemento conf
  2. medio ambiente $TMPDIR
  3. respaldo predeterminado /tmp

¿Estás de acuerdo?

ISO / IEC 9945 (POSIX): la ruta proporcionada por la primera variable de entorno que se encuentra en la lista TMPDIR, TMP, TEMP, TEMPDIR. Si no se encuentra ninguno de estos, "/ tmp".

Dado que estamos usando mkdtemp (POSIX 2008) de todos modos, probablemente podría usarlo también y deshacerse de algún código.

¡Gracias por la información! ¿Ha podido verificar que la solución propuesta en # 2090 corrige el problema de prueba fcrypt en el servidor de compilación?

si funciona en su sistema con TMPDIR = dir / that / existe ctest -R fcrypt, debería funcionar también en el servidor de compilación.

El problema debería solucionarse ahora.

Estoy de acuerdo

Todavía parece haber algún tipo de rareza con las pruebas. Ejecuto algunas compilaciones de master principalmente para ajustar el ejecutor y la configuración paralela, ya que ya no hacemos hyperthreading. Y en un caso, las pruebas fallaron repentinamente con el mismo problema de 'no se pudo instalar la clave' nuevamente:
https://build.libelektra.org/jenkins/blue/organizations/jenkins/libelektra/detail/master/122/pipeline/410

Siento acumularme aquí, pero también encontré el error failed to install the GPG test key . Utilizo un vm artful32 vagabundo y puedo reproducir constantemente estos errores (rama maestra):

 55/198 Test  #55: testmod_crypto_gcrypt ....................***Failed    0.60 sec
CYPTO        TESTS
==================

/home/jenkins/workspace/elektra-master-full-artful32/src/plugins/crypto/test_internals.h:273: error in test_gpg: failed to install the GPG test key

crypto_gcrypt Results: 65 Tests done — 1 error.
 66/198 Test  #66: testmod_fcrypt ...........................***Failed    0.03 sec
FCRYPT       TESTS
==================

/home/jenkins/workspace/elektra-master-full-artful32/src/plugins/fcrypt/testmod_fcrypt.c:160: error in test_gpg: failed to install the GPG test key
/home/jenkins/workspace/elektra-master-full-artful32/src/plugins/fcrypt/testmod_fcrypt.c:188: error in test_file_crypto_operations: kdb set failed
/home/jenkins/workspace/elektra-master-full-artful32/src/plugins/fcrypt/testmod_fcrypt.c:189: error in test_file_crypto_operations: file content did not change during encryption
/home/jenkins/workspace/elektra-master-full-artful32/src/plugins/fcrypt/testmod_fcrypt.c:192: error in test_file_crypto_operations: kdb get (pregetstorage) failed
/home/jenkins/workspace/elektra-master-full-artful32/src/plugins/fcrypt/testmod_fcrypt.c:196: error in test_file_crypto_operations: kdb get (postgetstorage) failed
/home/jenkins/workspace/elektra-master-full-artful32/src/plugins/fcrypt/testmod_fcrypt.c:197: error in test_file_crypto_operations: postgetstorage did not encrypt the file again
/home/jenkins/workspace/elektra-master-full-artful32/src/plugins/fcrypt/testmod_fcrypt.c:232: error in test_file_signature_operations: kdb set failed
/home/jenkins/workspace/elektra-master-full-artful32/src/plugins/fcrypt/testmod_fcrypt.c:233: error in test_file_signature_operations: file content did not change during encryption
/home/jenkins/workspace/elektra-master-full-artful32/src/plugins/fcrypt/testmod_fcrypt.c:236: error in test_file_signature_operations: kdb get failed

fcrypt Results: 39 Tests done — 9 errors.

Puedo proporcionar el archivo vagrant a través de PR si ayuda a reproducir los errores.

¡Gracias por informar! ¿Puede decirnos su TMPDIR y HOME? Intente reproducirlo con env -i .

@ petermax2 ¿Tienes tiempo para mirarlo?

Para los errores anteriores:
TMPDIR: vacío
INICIO: /home/jenkins/workspace/elektra-master-full-artful32/user

En cuanto a env -i , una prueba más falla entonces:

 54/198 Test  #54: testmod_crypto_openssl ...................***Failed    0.31 sec
CYPTO        TESTS
==================

/home/jenkins/workspace/elektra-master-full-artful32/src/plugins/crypto/test_internals.h:273: error in test_gpg: failed to install the GPG test key

crypto_openssl Results: 65 Tests done — 1 error.

No estoy seguro si esto es una coincidencia, pero esta fue la primera vez que esta prueba falló.

Puedo investigar durante el fin de semana. @mpranj, ¿ podrías enviarme el archivo vagabundo, por favor?

@ petermax2 el Vagrantfile y los pasos para reproducir están en # 2211. Espero que esto ayude a depurar el problema más fácilmente. Tal vez sea solo un problema de ENV.

$HOMEDIR no se borra una vez finalizado el caso de prueba, por lo que gpg-agent sigue ejecutándose, lo que causa el problema. Si GNUPGHOME se establece en un directorio diferente, el caso de prueba vuelve a tener éxito.

EDITAR: $HOMEDIR se está eliminando correctamente, pero gpgagent no se cierra como se esperaba.

EDITAR v2:

vagrant@ubuntu-artful:~/libelektra/build$ gpg --list-key
gpg: directory '/home/vagrant/.gnupg' created
gpg: new configuration file '/home/vagrant/.gnupg/dirmngr.conf' created
gpg: new configuration file '/home/vagrant/.gnupg/gpg.conf' created
gpg: keybox '/home/vagrant/.gnupg/pubring.kbx' created
gpg: /home/vagrant/.gnupg/trustdb.gpg: trustdb created
vagrant@ubuntu-artful:~/libelektra/build$ pgrep agent
3630
vagrant@ubuntu-artful:~/libelektra/build$ rm -rf /home/vagrant/.gnupg
vagrant@ubuntu-artful:~/libelektra/build$ pgrep agent
3630
vagrant@ubuntu-artful:~/libelektra/build$

¡Gracias por la investigación!

¿Hay alguna descripción general en qué versión hacen qué env vars y desde cuándo se cierra el agente gpg cuando se eliminan los archivos?

¿Cuál es la mejor manera de arreglar esto?

Perdón por el retraso, no he tenido tiempo de investigar más hasta ahora.

¿Hay alguna descripción general en qué versión hacen qué env vars y desde cuándo se cierra el agente gpg cuando se eliminan los archivos?

Toda la documentación que pude encontrar fue

_ (GNUPGHOME) Si se usa el directorio establecido en lugar de "~ / .gnupg" ._ [1]

¿Cuál es la mejor manera de arreglar esto?

No estoy seguro. No parece que haya una única solución que resuelva todos los problemas a los que nos enfrentamos con GnuPG. Una vez intenté guardar los PID de los agentes GnuPG iniciados, pero no salió bien.

¿Tienes alguna idea?

Fuentes

  • [1] [https://www.gnupg.org/documentation/manuals/gnupg/GPG-Configuration.html](https://www.gnupg.org/documentation/manuals/gnupg/GPG-Configuration.html)

¿Quizás no deberíamos intentar resolver todos los problemas posibles y solo admitir algunas versiones de gnupg?

¿Qué versiones de gnupg no se limpian después de eliminar sus archivos? ¿Son lo suficientemente relevantes como para apoyarlos? ¿Quizás simplemente deshabilitamos las pruebas para ellos?

¿Qué versiones de gnupg no se limpian después de eliminar sus archivos?

La versión de Ubuntu Artful (17.10) de gpg es la única versión hasta ahora en la que el agente no termina después de eliminar GNUPGHOME . No he visto este comportamiento en otras versiones de gpg.

El GPG en Ubuntu Artful es 2.1.15. En Ubuntu 18.04.1 se utiliza la versión 2.2.4 de gpg. La última versión es la 2.2.10.

Podríamos agregar una nota de dependencia de que se requiere la versión gpg> = 2.2.

Si entiende correctamente las notas de la versión, la terminación se implementa en la versión 2.1.16 de gpg. Consulte las notas de la versión .

EDITAR: la nota de la versión establece que la terminación solo se implementa para Linux. Lo que significa que en otros sistemas operativos deberíamos tener el mismo problema. Lo probaré en FreeBSD.

Lo probaré en FreeBSD.

Sí, gpg-agent todavía se está ejecutando después de que se haya eliminado GNUPGHOME .

ATM Estoy probando otra solución. Al ejecutar gpg-connect-agent KILLAGENT cierra el agente en la versión 2.2.4 de gpg. Si execv este comando después de que se complete la prueba unitaria, el gpg-agent debería cerrarse. Probaré esta solución en Linux y FreeBSD. ¡Espere un comentario o, con suerte, un PR!

Vuelva a abrir este problema si el problema se repite.

¿Fue útil esta página
0 / 5 - 0 calificaciones

Temas relacionados

mpranj picture mpranj  ·  3Comentarios

markus2330 picture markus2330  ·  3Comentarios

mpranj picture mpranj  ·  3Comentarios

dmoisej picture dmoisej  ·  3Comentarios

markus2330 picture markus2330  ·  4Comentarios