-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize dynamic loading of IaaS Credentials using credential file ti…
…mestamps (#670) * Dynamic access credential rotation unit tests written for all providers * Unit tests for GetSnapstoreSecretModifiedTime() use idiomatic `time` functions * Unit tests reworked to fix concourse build * Changes to test GinkgoT and os temp directories for unit tests for dynamic loading * Added a direct os.Stat to ensure the correct time is being fetched * Workaround to change the modification time of a credential file in the unit test * Writing to the file does not change the modification time on the concourse machine. This is worked around by recreating the credential file. * Better logging during the tests for easier debugging. * Changed the directory used by the dynamic credential loading unit tests * The directory is set to /test/credential to store the files. * Cleaner logging. * Added test to verify concourse's time modification os call * Added a time.Sleep() before modifying the file. * Replaced random file deletion test with file deletion of each possible credential file * Unit tests now use a sleep to fix issues on concourse, .ci/unit_test restored so all tests run. * Addressing review comments for units tests of dynamic credential loading 1 * Dynamic credential loading unit tests: removed file creation and updation logs * `GetSnapstoreSecretModifiedTime` unit tests rewritten using `GinkgoT().TempDir()` and structs for cleaner tests. * Only Ginkgo provided temporary directories are used for the unit tests. * Structs defined where each instance holds all relevant information for the test. * Same tests cover both directory flow and JSON flow. * Addressing review comments * Changed a few function definition comments * Changed the verb to `%q` in Ginkgo nodes' strings for better string formatting
- Loading branch information
1 parent
635dd4d
commit 6958118
Showing
10 changed files
with
445 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.