certtools/intelmq

intelmqctl and intelmqdump tests require an installed IntelMQ instance

wagner-intevation opened this issue · 0 comments

This is a revival of #2300 (ctl tests require an installed IntelMQ instance). These tests are affected now:

  • TestIntelMQController::test_check_handles_syntaxerror_when_importing_bots
  • TestIntelMQController::test_check_pass_with_default_runtime
  • TestIntelMQController::test_check_passed_with_default_harmonization_and_empty_runtime
  • TestIntelMQDump::test_get_dump_for_one_bot
  • TestIntelMQDump::test_list_and_select_dump_from_custom_location
  • TestIntelMQDump::test_list_and_select_dump_from_global_location
  • TestIntelMQDump::test_list_dumps_for_all_bots_from_custom_locations
  • TestIntelMQDump::test_list_dumps_for_all_bots_from_default_log_path
  • TestIntelMQDump::test_selecting_dump_warns_when_filename_is_ambiguous

the ctl tests have a traceback like this:

[  152s]   File "/usr/src/packages/BUILD/.pybuild/cpython3_3.9_intelmq/build/intelmq/lib/utils.py", line 224, in load_configuration
[  152s]     raise ValueError('File not found: %r.' % configuration_filepath)
[  152s] ValueError: File not found: '/etc/intelmq/runtime.yaml'.
[  152s] ERROR    intelmqctl:intelmqctl.py:127 No valid IntelMQ installation found: DistributionNotFound

and the dump tests don't find any dumps.

So I suggest to add a new skip-decorator and environment variable to skip tests depending on an installation by default. This also addresses https://lists.cert.at/pipermail/intelmq-dev/2023-May/000610.html