libelektra: testshell_markdown_tutorial_crypto fails
On my laptop, which uses buster and has several gpg keys, testshell_markdown_tutorial_crypto fails. If the test is executed with ctest -V -R testshell_markdown_tutorial_crypto it opens a pinentry for my key, which obviously should not be like this as the test case should have its own key.
Test project /home/markus/Projekte/Elektra/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 220
Start 220: testshell_markdown_tutorial_crypto
220: Test command: /home/markus/Projekte/Elektra/build/tests/shell/shell_recorder/tutorial_wrapper/markdown_shell_recorder.sh "/home/markus/Projekte/Elektra/current/doc/tutorials/crypto.md"
220: Environment variables:
220: LD_LIBRARY_PATH=/home/markus/Projekte/Elektra/build/lib
220: Test timeout computed to be: 1500
220: Input: /home/markus/Projekte/Elektra/current/doc/tutorials/crypto.md
220: kdb mount test.ini user/tests ini
220: kdb set user/tests/password 1234
220: kdb file user/tests/password | xargs cat
220: kdb rm user/tests/password
220: kdb umount user/tests
220: kdb mount test.ini user/tests fcrypt "encrypt/key=$(kdb gen-gpg-testkey)" ini
220: kdb set user/tests/password 1234
220:
220: ERROR - RET:
220: Return value “5” does not match “0”
220:
220: kdb file user/tests/password | xargs cat
220:
220: ERROR - RET:
220: Return value “123” does not match “0”
220:
220: kdb rm user/tests/password
220:
220: ERROR - RET:
220: Return value “11” does not match “0”
220:
220: kdb umount user/tests
220: kdb mount test.ini user/tests fcrypt "sign/key=$(kdb gen-gpg-testkey)" ini
220: kdb set user/tests/password 1234
220:
220: ERROR - RET:
220: Return value “5” does not match “0”
220:
220: kdb file user/tests/password | xargs cat
220:
220: ERROR - RET:
220: Return value “123” does not match “0”
220:
220: kdb rm user/tests/password
220:
220: ERROR - RET:
220: Return value “11” does not match “0”
220:
220: kdb umount user/tests
220: kdb mount test.ini user/tests fcrypt "sign/key=$(kdb gen-gpg-testkey),encrypt/key=$(kdb gen-gpg-testkey)" ini
220: kdb set user/tests/password 1234
220:
220: ERROR - RET:
220: Return value “5” does not match “0”
220:
220: kdb file user/tests/password | xargs cat
220:
220: ERROR - RET:
220: Return value “123” does not match “0”
220:
220: kdb rm user/tests/password
220:
220: ERROR - RET:
220: Return value “11” does not match “0”
220:
220: kdb umount user/tests
220: kdb mount test.ini user/tests crypto_gcrypt "crypto/key=$(kdb gen-gpg-testkey)" base64 ini
220: kdb setmeta user/tests/password crypto/encrypt 1
220: kdb set user/tests/password 1234
220: kdb set user/tests/unencrypted "I am not encrypted"
220: kdb file user/tests/password | xargs cat
220: kdb setmeta user/tests/password crypto/encrypt 0
220: kdb file user/tests/password | xargs cat
220: kdb rm user/tests/unencrypted
220: kdb rm user/tests/password
220: kdb umount user/tests
220: shell_recorder /tmp/tmp.SFkbumzoDP RESULTS: 31 test(s) done 9 error(s).
220:
220: —— Protocol ————————————————————————————————————————————————————
220: CMD: kdb mount test.ini user/tests ini
220: RET: 0
220:
220: CMD: kdb set user/tests/password 1234
220: RET: 0
220: STDOUT: Create a new key user/tests/password with string "1234"
220:
220: CMD: kdb file user/tests/password | xargs cat
220: RET: 0
220: STDOUT: password=1234
220:
220: CMD: kdb rm user/tests/password
220: RET: 0
220:
220: CMD: kdb umount user/tests
220: RET: 0
220:
220: CMD: kdb mount test.ini user/tests fcrypt "encrypt/key=$(kdb gen-gpg-testkey)" ini
220: RET: 0
220:
220: CMD: kdb set user/tests/password 1234
220: RET: 5
220: === FAILED return value does not match expected pattern 0
220: STDERR: Sorry, module fcrypt issued the error C01100:
220: Resource: Renaming file /tmp/test.ini.28619:1568523969.513222.tmpiKxwWb to /home/markus/.config/test.ini.28619:1568523969.513222.tmp failed. Reason: Invalid cross-device link
220: ERROR: C01100
220:
220: CMD: kdb file user/tests/password | xargs cat
220: RET: 123
220: === FAILED return value does not match expected pattern 0
220: STDERR: cat: /home/markus/.config/test.ini: Datei oder Verzeichnis nicht gefunden
220:
220: CMD: kdb rm user/tests/password
220: RET: 11
220: === FAILED return value does not match expected pattern 0
220: STDERR: Did not find the key
220:
220: CMD: kdb umount user/tests
220: RET: 0
220:
220: CMD: kdb mount test.ini user/tests fcrypt "sign/key=$(kdb gen-gpg-testkey)" ini
220: RET: 0
220:
220: CMD: kdb set user/tests/password 1234
220: RET: 5
220: === FAILED return value does not match expected pattern 0
220: STDERR: Sorry, module fcrypt issued the error C01100:
220: Resource: Renaming file /tmp/test.ini.28833:1568523969.829088.tmpYQyRfB to /home/markus/.config/test.ini.28833:1568523969.829088.tmp failed. Reason: Invalid cross-device link
220: ERROR: C01100
220:
220: CMD: kdb file user/tests/password | xargs cat
220: RET: 123
220: === FAILED return value does not match expected pattern 0
220: STDERR: cat: /home/markus/.config/test.ini: Datei oder Verzeichnis nicht gefunden
220:
220: CMD: kdb rm user/tests/password
220: RET: 11
220: === FAILED return value does not match expected pattern 0
220: STDERR: Did not find the key
220:
220: CMD: kdb umount user/tests
220: RET: 0
220:
220: CMD: kdb mount test.ini user/tests fcrypt "sign/key=$(kdb gen-gpg-testkey),encrypt/key=$(kdb gen-gpg-testkey)" ini
220: RET: 0
220:
220: CMD: kdb set user/tests/password 1234
220: RET: 5
220: === FAILED return value does not match expected pattern 0
220: STDERR: Sorry, module fcrypt issued the error C01100:
220: Resource: Renaming file /tmp/test.ini.29064:1568523970.266048.tmp7T6B0X to /home/markus/.config/test.ini.29064:1568523970.266048.tmp failed. Reason: Invalid cross-device link
220: ERROR: C01100
220:
220: CMD: kdb file user/tests/password | xargs cat
220: RET: 123
220: === FAILED return value does not match expected pattern 0
220: STDERR: cat: /home/markus/.config/test.ini: Datei oder Verzeichnis nicht gefunden
220:
220: CMD: kdb rm user/tests/password
220: RET: 11
220: === FAILED return value does not match expected pattern 0
220: STDERR: Did not find the key
220:
220: CMD: kdb umount user/tests
220: RET: 0
220:
220: CMD: kdb mount test.ini user/tests crypto_gcrypt "crypto/key=$(kdb gen-gpg-testkey)" base64 ini
220: RET: 0
220:
220: CMD: kdb setmeta user/tests/password crypto/encrypt 1
220: RET: 0
220:
220: CMD: kdb set user/tests/password 1234
220: RET: 0
220: STDOUT: Set string to "1234"
220:
220: CMD: kdb set user/tests/unencrypted "I am not encrypted"
220: RET: 0
220: STDOUT: Create a new key user/tests/unencrypted with string "I am not encrypted"
220:
220: CMD: kdb file user/tests/password | xargs cat
220: RET: 0
220: STDOUT: unencrypted=I am not encrypted
220: #@META crypto/encrypt = 1
220: password=@BASE64IyFjcnlwdG8wMBEAAAAtetcvCr4QmzanFLTfM1CsHkl03scQOwm8ywpbowM7lqGFB3W3G37UCSmPr3ugIpq6
220:
220: CMD: kdb setmeta user/tests/password crypto/encrypt 0
220: RET: 0
220:
220: CMD: kdb file user/tests/password | xargs cat
220: RET: 0
220: STDOUT: unencrypted=I am not encrypted
220: #@META crypto/encrypt = 0
220: password=1234
220:
220: CMD: kdb rm user/tests/unencrypted
220: RET: 0
220:
220: CMD: kdb rm user/tests/password
220: RET: 0
220:
220: CMD: kdb umount user/tests
220: RET: 0
220: ————————————————————————————————————————————————————————————————
1/1 Test #220: testshell_markdown_tutorial_crypto ...***Failed 4.10 sec
0% tests passed, 1 tests failed out of 1
Label Time Summary:
kdbtests = 4.10 sec*proc (1 test)
memleak = 4.10 sec*proc (1 test)
Total Test time (real) = 4.11 sec
The following tests FAILED:
220 - testshell_markdown_tutorial_crypto (Failed)
Errors while running CTest
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (16 by maintainers)
Commits related to this issue
- tools: fix key description in gen-gpg-testkey The string 'gen-gpg-testkey' is being put into the key description to prevent mismatches with libelektra.org e-mail addresses. See #2957 for full discuss... — committed to petermax2/libelektra by petermax2 5 years ago
- tools: fix key description in gen-gpg-testkey The string 'gen-gpg-testkey' is being put into the key description to prevent mismatches with libelektra.org e-mail addresses. See #2957 for full discuss... — committed to petermax2/libelektra by petermax2 5 years ago
I found the problem:
gen-gpg-testkeyis looking for “elektra” and I guess your e-mail address contains something with “elektra.org”, so it will falsely use it as test-key which is supposed to have no password…https://github.com/ElektraInitiative/libelektra/blob/fa6d9597dfad75ccd712a7628b404e2eee218cb0/src/tools/gen-gpg-testkey/gen-gpg-testkey.c#L36-L37