As you can see, this is done rather lazily - the path is just replicating what is on the host machine (for local files) or going into a temporary directory for files coming from a remote Git repository.
If we were more deliberate about where we put these test hook files (and how they are named, for that matter), we could take advantage of the tools in /var/lib/irods/scripts in the test hooks. This approach carries with it a disadvantage: The test hooks would be dependent on existing in a specific location whereas they are now independent of a specific location in the filesystem. Arguably, the test hooks should just be packaged with the plugins and placed in the right spot if we wanted to do that, but doing this in the testing environment could be a good start.
This issue was spawned from this: https://github.com/irods/irods_auth_plugin_pam_interactive/issues/48#issuecomment-2292151862 Being able to use irods.paths would allow us to get away from hard-coded paths in the test hooks. As mentioned in that comment, an alternative solution would be to make a library of tools in irods_python_ci_utilities which perform similar functions.
Here's the place where we put test hook script files into test containers: https://github.com/irods/irods_testing_environment/blob/615a2e24379b1b3733d7ec4ac6ed03afe8711d47/irods_testing_environment/test_runner.py#L298-L301
And here are the definitions for the functions called there: https://github.com/irods/irods_testing_environment/blob/615a2e24379b1b3733d7ec4ac6ed03afe8711d47/irods_testing_environment/test_runner.py#L244-L273
As you can see, this is done rather lazily - the path is just replicating what is on the host machine (for local files) or going into a temporary directory for files coming from a remote Git repository.
If we were more deliberate about where we put these test hook files (and how they are named, for that matter), we could take advantage of the tools in
/var/lib/irods/scripts
in the test hooks. This approach carries with it a disadvantage: The test hooks would be dependent on existing in a specific location whereas they are now independent of a specific location in the filesystem. Arguably, the test hooks should just be packaged with the plugins and placed in the right spot if we wanted to do that, but doing this in the testing environment could be a good start.This issue was spawned from this: https://github.com/irods/irods_auth_plugin_pam_interactive/issues/48#issuecomment-2292151862 Being able to use
irods.paths
would allow us to get away from hard-coded paths in the test hooks. As mentioned in that comment, an alternative solution would be to make a library of tools inirods_python_ci_utilities
which perform similar functions.