Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: unit/crypto.test flaky fails #4306

Closed
Totktonada opened this issue Jun 23, 2019 · 1 comment
Closed

test: unit/crypto.test flaky fails #4306

Totktonada opened this issue Jun 23, 2019 · 1 comment
Assignees
Labels
flaky test qa Issues related to tests or testing subsystem

Comments

@Totktonada
Copy link
Member

Tarantool version: 2.2.0-465-g88a232903 Linux-x86_64-Debug.
OS version: Gentoo Linux.

Reproduced by Travis-CI and locally:

TEST_RUN_TESTS="$(yes unit/crypto.test | head -n 1000)" make test
[011] Test failed! Result content mismatch:
[011] --- unit/crypto.result	Sat Jun 22 18:46:06 2019
[011] +++ unit/crypto.reject	Sun Jun 23 18:50:16 2019
[011] @@ -1,3 +1,9 @@
[011] +    #   Failed test 'decrypt can fail with wrong IV'
[011] +    #   in /home/alex/p/tarantool-meta/r/t-2/test/unit/crypto.c at line 92
[011] +    # Looks like you failed 1 test of 20 run.
[011] +#   Failed test 'subtests'
[011] +#   in /home/alex/p/tarantool-meta/r/t-2/test/unit/unit.c at line 54
[011] +# Looks like you failed 1 test of 5 run.
[011]  	*** main ***
[011]  1..5
[011]  ok 1 - crypto checks that algo argument is correct
[011] @@ -15,7 +21,7 @@
[011]      ok 10 - decrypt also checks length and returns needed number of bytes
[011]      ok 11 - decrypt returns correct number of bytes
[011]      ok 12 - and correctly decrypts data
[011] -    ok 13 - decrypt can fail with wrong IV
[011] +    not ok 13 - decrypt can fail with wrong IV
[011]      ok 14 - diag error is set
[011]      ok 15 - encrypt with different IV and the same number of written bytes returned
[011]      ok 16 - the encrypted data looks different
[011] @@ -23,7 +29,7 @@
[011]      ok 18 - data is the same
[011]      ok 19 - encrypt with one codec, but decrypt with another codec and the same key
[011]      ok 20 - data is the same
[011] -ok 2 - subtests
[011] +not ok 2 - subtests
[011]  	*** test_aes128_codec: done ***
[011]  	*** test_aes128_stress ***
[011]      1..1
@Totktonada Totktonada added qa Issues related to tests or testing subsystem flaky test labels Jun 23, 2019
@Gerold103
Copy link
Collaborator

Seems like sometimes crypto_codec_gen_iv generates such an IV, that it causes not decryption error with a different IV, but just a wrong decryption. Probably that test should be just dropped.

Gerold103 added a commit that referenced this issue Jun 23, 2019
One of subtests was checking if crypto_decode returns an error
when fails to decode. But due to randomness of the test sometimes
it happened, that initial vector of encrypted data somehow didn't
lead to an error. Decryption was not correct, but only in terms
of result, not in terms of decryption algorithm. -1 was not
returned, and diag was not set.

This patch checks all the cases.

Closes #4306
@Gerold103 Gerold103 self-assigned this Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky test qa Issues related to tests or testing subsystem
Projects
None yet
Development

No branches or pull requests

2 participants