![]() |
![]()
| ![]() |
![]()
NameOpenXPKI::Tests DescriptionThis is a helper module for the OpenXPKI test suites. It adds a lot of helper functions for deploying, starting, stopping a server as well as own test functions that add tests for various things. FunctionsAll of these functions are exported into the caller namespace for easier calling (and because it is assumed that tests don't use much of the namespace for themselves anyways). deploy_test_serverDeploys test server configuration. Takes a named argument of 'DIRECTORY', which is the directory into which the server will be deployed. Returns 1 if deployment was successfull, 0 otherwise. create_ca_certCreates a CA certificate using OpenSSL for installation in a freshly deployed test server. Takes a named argument of 'DIRECTORY', which is the directory of the deployed server. Also imports the certificate into the OpenXPKI database and creates an appropriate alias for it. Then patches the config file to use the literal password for the key. This enables you to start a test server with a working CA certificate using start_test_server(). start_test_serverStarts the deployed test server. Takes an optional argument of FOREGROUND, which will start the server in the foreground (this is useful so that a forked child can send commands to the server and the coverage report gets server information instead of client information). The named argument 'DIRECTORY' is the one used in deploy_test_server() to find the corresponding configuration file. Returns 1 if starting the server was successfull, 0 otherwise. loginExpects the named arguments CLIENT (which is an OpenXPKI::Client object), USER and PASSWORD. Initializes the client session and logs the user in using the Operator stack and the given username and password. Returns 1 on success, 0 on failure. is_error_responseExpects a message returned by a call to send_receive_command_msg(). Returns 1 if the response from the server signifies an error, 0 otherwise. isnt_deeplyChecks that structures differ deeply. This is the opposite of is_deeply from Test::More.
|