dkms.in: Handle error cases in autoinstall#262
Conversation
|
Thanks for the fixes - can you add some tests? It will help visualise the changes and should be less likely to break in the future. |
I've added some failing test modules and tests to the bash script. Let me know if there's anything further required. |
8ae1626 to
1163414
Compare
1163414 to
aeb2ece
Compare
|
@evelikov - It looks like the changes in #265 broke all tests for me. Even when I switch back to the master branch, clean, and rebuild, I can't run the tests. I don't want this PR to get more complicated than it already is by trying to fix those tests here. Any chance of either getting the tests fixed or reverting those changes for now? Edit to add: Edit 2:
|
aeb2ece to
059efff
Compare
The autoinstall functionality was treating modules as installed even if the install failed. This change updates the logic to try installing the module but not treat it as successfully installed if an error occurs during the install attempt. Signed-off-by: Charlie Johnston <charlie.johnston@ni.com>
…tall. If a module fails to autoinstall due to errors during install or missing dependencies, dkms currently still returns an exit code of 0. This change ensures that a failing install or missing dependency returns a non-zero exit code and reports an error instead. Signed-off-by: Charlie Johnston <charlie.johnston@ni.com>
This change updates helper methods in run-test.sh such that modules other than dkms_test could be used for new tests in the future. The helper methods have been updated to allow arbitrary module names as inputs. Signed-off-by: Charlie Johnston <charlie.johnston@ni.com>
The dkms status case is special in these tests as the tests filter to just the status of the module in quesiton. This means instead of checking a dkms command for the expected output, it was checking a helper method's output. This change adds a new helper method specifically for dkms status and checking its output. Signed-off-by: Charlie Johnston <charlie.johnston@ni.com>
The logic to genericize the expected output via sed was previously only used for run_with_expected_output and not by run_with_expected_error. Splitting that into a helper method allows it to be used in both places. This change also uses a variable for the log file names so that only one place needs updated in each helper. Signed-off-by: Charlie Johnston <charlie.johnston@ni.com>
059efff to
654b39c
Compare
|
Looks great thank you. Assuming the CI doesn't flag any issues, will merge this shortly - don't want another set of merge conflicts. |
Hmm, looks like this line gets printed in the output on the Ubuntu tests in the CI: |
@evelikov - Added a filter for the error output in the CI. |
|
The CI is failing - if I'm reading it correctly, that's because the See the successful test "Running dkms autoinstall" aka |
9f3b29a to
dbd7812
Compare
@evelikov - Done. |
dbd7812 to
5835499
Compare
|
Forget to escape the sed command string, should be good now. |
|
The pesky python3 warning is still there - the rest have been fixed. |
5835499 to
e62e368
Compare
Should be fixed now. Tested it manually since I wasn't seeing the issue on my machine. |
This change adds tests for cases where dkms autoinstall will fail and return an error. This required adding two new test modules to cover the case where a module fails to build and the case where a module is missing a dependency. Signed-off-by: Charlie Johnston <charlie.johnston@ni.com>
Signed-off-by: Charlie Johnston <charlie.johnston@ni.com>
e62e368 to
a39fec7
Compare
|
@evelikov - Thank you for getting this completed! I was on vacation so definitely appreciate it. |
Currently, autoinstall has two issues with error handling:
These two commits correct these behaviors to reflect the actual errors that occur.
Testing:
Ran locally and confirmed the error cases are now handled.