-
Notifications
You must be signed in to change notification settings - Fork 22
Allow passing config as a fixture #78
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
Allow passing config as a fixture #78
Conversation
Weird, I can run and pass all the test locally. Is there anyway I can view the logs? (Or I guess another PR for printing the log file on CI? 😄) |
I'll see if I can reproduce here; if that's also passing, maybe a CI update would be handy... |
Yeah, all passes here too - not sure what's up with the runner environment... |
On non-bus-owner modes, link->slot_busowner will be uninitialized, leading to segmentation fault when running sd_bus_slot_unref. ==3850684== Conditional jump or move depends on uninitialised value(s) ==3850684== at 0x48FB448: sd_bus_slot_unref (in /usr/lib/aarch64-linux-gnu/libsystemd.so.0.38.0) ==3850684== by 0x1123E3: free_link (mctpd.c:3263) ==3850684== by 0x1125CB: free_links (mctpd.c:3308) ==3850684== by 0x113D63: main (mctpd.c:3900) Simply zero initialize the link data. Signed-off-by: Khang D Nguyen <[email protected]>
Seems like ASAN caught some more bugs, I can reproduce with |
OK, I had a run here with |
ASAN complained about this config file path memory leak. Free it on program exit. Also, there is a clangd warning on implicitly freeing const char*. Instead of casting to void* explicitly, I changed it to be char* to reflect the fact that we own the string allocation better. Signed-off-by: Khang D Nguyen <[email protected]>
mctpd now requests a config fixture, which is None by default to ensure previous behaviour. Test authors can now override the config using pytest fixtures overriding facility. An example on overriding per file basis is included in the commit. Signed-off-by: Khang D Nguyen <[email protected]>
6471906
to
b2463e1
Compare
CI passed now. There was a memory leak when we copied the config file path from CLI args. |
This MR adds the capability to write tests for
mctpd
as an endpoint. This caught an uninitialized read bug on link data.