Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose RefTime in API for testing #678

Closed
jku opened this issue Feb 9, 2025 · 1 comment
Closed

expose RefTime in API for testing #678

jku opened this issue Feb 9, 2025 · 1 comment

Comments

@jku
Copy link
Member

jku commented Feb 9, 2025

A go-tuf client uses TrustedMetadata.RefTime as the clients refresh reference time: normally this set to time.Now().UTC().

For testing purposes it would be useful if RefTime could be set to other values. tuf-conformance tries to handle this by using faketime but this does not work with golang (since golang does not use the system calls that faketime changes with LD_PRELOAD): theupdateframework/tuf-conformance#263. I believe the only way for tuf-conformance to be able to do this is to either:

  • change actual system time -- this is not a good idea in a test suite
  • have some sort of ability to modify RefTime via the API -- or maybe this exists already somehow?
@jku
Copy link
Member Author

jku commented Feb 9, 2025

oh! Updater.UnsafeSetRefTime() looks very promising... Maybe this only needs some work in the test client (which currently lives in tuf-conformance but should be in this repo #649 )

I'm going to close this as that looks like it will work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant