ctest-related question: how to test functionality with totp authentication ?

Hi,

I’d like to test functionality with totp-based authentication.
My issue is that the totp-token is valid for 30 seconds, and once I have used it for successfully logging in, I need a new token for the next login, but I only get a new token after 30 seconds (the totp timeout).
So I could add a delay before running a test until a new token is generated. This will work, but it will mean that each test will need at least 30 seconds, i.e. quite long.
Ideally I’d like to login, test a specific function, log out, run the next test.
It would also be Ok to login once during a ctest invocation, so that all tests executed by this ctest will use the same login. This would still mean that between two ctest invocations there must be at least 30 seconds, so that the next ctest will get a new token.

How do you deal with such setups, any pointers ?

Thanks