On 08/08/2019 16:54, Arne Schwabe wrote:
> From: Arne Schwabe <a...@openvpn.net>
> 
> Patch V2: adapt unit tests to other V2 patches
> Patch V4: Resolve rebase conflicts
> Patch V5: Add \ lost in rebase that broke compilation
> ---
>  tests/unit_tests/openvpn/Makefile.am       |  18 +-
>  tests/unit_tests/openvpn/test_auth_token.c | 375 +++++++++++++++++++++
>  2 files changed, 392 insertions(+), 1 deletion(-)
>  create mode 100644 tests/unit_tests/openvpn/test_auth_token.c

Code generally looks good.  But I do have some nitpicks here though.

* Many of the lines break our 80 chars per line rule
* The "dummy" functions added at the end of the test_auth_token.c file should
  be declared higher up and not after the main() function.

And finally ... the unit test doesn't pass for me :/

------------------------------------------------------
[==========] Running 8 test(s).
[ RUN      ] auth_token_basic_test
[       OK ] auth_token_basic_test
[ RUN      ] auth_token_fail_invalid_key
--auth-token-gen: HMAC on token from client failed (test user name)
[       OK ] auth_token_fail_invalid_key
[ RUN      ] auth_token_test_known_keys
[       OK ] auth_token_test_known_keys
[ RUN      ] auth_token_test_empty_user
[  ERROR   ] --- 0x3 != 0x7
[   LINE   ] --- test_auth_token.c:265: error: Failure!
[  FAILED  ] auth_token_test_empty_user
[ RUN      ] auth_token_test_env
[       OK ] auth_token_test_env
[ RUN      ] auth_token_test_random_keys
[       OK ] auth_token_test_random_keys
[ RUN      ] auth_token_test_key_load
--auth-token-gen: HMAC on token from client failed (test user name)
[       OK ] auth_token_test_key_load
[ RUN      ] auth_token_test_timeout
[       OK ] auth_token_test_timeout
[==========] 8 test(s) run.
[  PASSED  ] 7 test(s).
[  FAILED  ] 1 test(s), listed below:
[  FAILED  ] auth_token_test_empty_user

 1 FAILED TEST(S)
------------------------------------------------------

Seems like the verify_auth_token() call doesn't add
AUTH_TOKEN_VALID_EMPTYUSER flag.  I didn't dive deep enough to try to
understand why.


-- 
kind regards,

David Sommerseth
OpenVPN Inc



_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to