There's two commits in this series, the first adjusts the error handling used in the azure-init binary to make clearer to read through. The second adjusts the libazureinit APIs that make use of the reqwest::Client to accept it as an argument. This allows the caller to control the configuration. Finally, the client is configured in azure-init to have a user-agent along with a timeout.
How to use
Beyond building and running the existing tests, there's not yet tests to assert this actually works. The functional test looks to replicate the azure-init binary, so I think it would be interesting to have the test script copy over the actual binary and then make make some assertions about the queries it issues to the metadata service. I assume there's a way to see the requests a guest issues, but need to read up on that.
Testing done
I compiled it and ran the functional test, but that doesn't make any assertions about the change here.
There's two commits in this series, the first adjusts the error handling used in the
azure-init
binary to make clearer to read through. The second adjusts thelibazureinit
APIs that make use of thereqwest::Client
to accept it as an argument. This allows the caller to control the configuration. Finally, the client is configured inazure-init
to have a user-agent along with a timeout.How to use
Beyond building and running the existing tests, there's not yet tests to assert this actually works. The functional test looks to replicate the
azure-init
binary, so I think it would be interesting to have the test script copy over the actual binary and then make make some assertions about the queries it issues to the metadata service. I assume there's a way to see the requests a guest issues, but need to read up on that.Testing done
I compiled it and ran the functional test, but that doesn't make any assertions about the change here.