Skip to content

Commit

Permalink
Add automated test for decrypt command
Browse files Browse the repository at this point in the history
  • Loading branch information
kimci86 committed May 13, 2024
1 parent c0a62b3 commit 1300256
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ add_test(NAME cli.decipher COMMAND ${CMAKE_COMMAND}
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/decipher.cmake)

add_test(NAME cli.decrypt COMMAND ${CMAKE_COMMAND}
-DBKCRACK_COMMAND=$<TARGET_FILE:bkcrack>
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/decrypt.cmake)

add_test(NAME cli.change-password COMMAND ${CMAKE_COMMAND}
-DBKCRACK_COMMAND=$<TARGET_FILE:bkcrack>
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
Expand Down
10 changes: 10 additions & 0 deletions tests/decrypt.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include(${PROJECT_SOURCE_DIR}/tests/verify_hash.cmake)

execute_process(
COMMAND ${BKCRACK_COMMAND}
-C ${PROJECT_SOURCE_DIR}/example/secrets.zip
-k c4490e28 b414a23d 91404b31
-D decrypt.zip
COMMAND_ERROR_IS_FATAL ANY)
verify_hash(decrypt.zip 7365b22e535e545fc60952e82acea961dce512d939dd01545e0a20f7fe82bb8e)
file(REMOVE decrypt.zip)

0 comments on commit 1300256

Please sign in to comment.