Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 932836 - net-analyzer/greenbone-feed-sync-24.3.0 fails tests
Summary: net-analyzer/greenbone-feed-sync-24.3.0 fails tests
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Giuseppe Foti
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2024-05-27 06:51 UTC by Agostino Sarubbo
Modified: 2024-07-04 08:25 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,140.41 KB, text/plain)
2024-05-27 06:51 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2024-05-27 06:51:42 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: net-analyzer/greenbone-feed-sync-24.3.0 fails tests.
Discovered on: amd64 (internal ref: lto_tinderbox)
System: LTO-SYSTEM (https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#LTO)

Info about the issue:
https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#CF0015
Comment 1 Agostino Sarubbo gentoo-dev 2024-05-27 06:51:44 UTC
Created attachment 894507 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2024-05-27 06:51:44 UTC
Error(s) that match a know pattern:


ERROR: test_argument_takes_precedence (tests.test_parser.CliParserTestCase)
ERROR: test_cert_data_destination (tests.test_parser.CliParserTestCase)
ERROR: test_cert_data_url (tests.test_parser.CliParserTestCase)
ERROR: test_compression_level (tests.test_parser.CliParserTestCase)
ERROR: test_config (tests.test_parser.CliParserTestCase)
ERROR: test_defaults (tests.test_parser.CliParserTestCase)
ERROR: test_environment_takes_precedence (tests.test_parser.CliParserTestCase)
ERROR: test_fail_fast (tests.test_parser.CliParserTestCase)
ERROR: test_feed_url_from_enterprise_feed_key (tests.test_parser.CliParserTestCase)
ERROR: test_from_environment (tests.test_parser.CliParserTestCase)
ERROR: test_greenbone_cert_data_sync (tests.test_parser.CliParserTestCase)
ERROR: test_greenbone_enterprise_feed_key (tests.test_parser.CliParserTestCase)
ERROR: test_greenbone_nvt_sync (tests.test_parser.CliParserTestCase)
ERROR: test_greenbone_scap_data_sync (tests.test_parser.CliParserTestCase)
ERROR: test_group (tests.test_parser.CliParserTestCase)
ERROR: test_gvmd_data_destination (tests.test_parser.CliParserTestCase)
ERROR: test_gvmd_data_url (tests.test_parser.CliParserTestCase)
ERROR: test_gvmd_lock_file (tests.test_parser.CliParserTestCase)
ERROR: test_help (tests.test_parser.CliParserTestCase)
ERROR: test_ignore_non_existing_enterprise_feed_key (tests.test_parser.CliParserTestCase)
ERROR: test_load_from_default_config (tests.test_parser.CliParserTestCase)
ERROR: test_nasl_destination (tests.test_parser.CliParserTestCase)
ERROR: test_nasl_url (tests.test_parser.CliParserTestCase)
ERROR: test_no_wait (tests.test_parser.CliParserTestCase)
ERROR: test_notus_destination (tests.test_parser.CliParserTestCase)
ERROR: test_notus_url (tests.test_parser.CliParserTestCase)
ERROR: test_openvas_lock_file (tests.test_parser.CliParserTestCase)
ERROR: test_other (tests.test_parser.CliParserTestCase)
ERROR: test_port_lists_destination (tests.test_parser.CliParserTestCase)
ERROR: test_port_lists_url (tests.test_parser.CliParserTestCase)
ERROR: test_private_directory (tests.test_parser.CliParserTestCase)
ERROR: test_quiet (tests.test_parser.CliParserTestCase)
ERROR: test_report_formats_destination (tests.test_parser.CliParserTestCase)
ERROR: test_report_formats_url (tests.test_parser.CliParserTestCase)
ERROR: test_rsync_timeout (tests.test_parser.CliParserTestCase)
ERROR: test_scan_configs_destination (tests.test_parser.CliParserTestCase)
ERROR: test_scan_configs_url (tests.test_parser.CliParserTestCase)
ERROR: test_scap_data_destination (tests.test_parser.CliParserTestCase)
ERROR: test_scap_data_url (tests.test_parser.CliParserTestCase)
ERROR: test_selftest (tests.test_parser.CliParserTestCase)
ERROR: test_type (tests.test_parser.CliParserTestCase)
ERROR: test_use_default_config_files (tests.test_parser.CliParserTestCase)
ERROR: test_user (tests.test_parser.CliParserTestCase)
ERROR: test_verbose (tests.test_parser.CliParserTestCase)
ERROR: test_wait_interval (tests.test_parser.CliParserTestCase)
FAILED (errors=45)
PermissionError: [Errno 13] Permission denied: '/etc/gvm/greenbone-enterprise-feed-key'
PermissionError: [Errno 13] Permission denied: '/etc/gvm/greenbone-feed-sync.toml'
Comment 3 Eli Schwartz gentoo-dev 2024-06-28 00:47:42 UTC
commit 0375a7b2b589d7ffe2b73a3426d8c0abd4f4b38e
Author:     Florian Schmaus <flow@gentoo.org>
AuthorDate: Tue Apr 16 02:59:57 2024
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: Tue Apr 16 03:04:18 2024

    net-analyzer/greenbone-feed-sync: drop config file patching in src_test
    
    It turns out that, first, this is not necessary. At least I do not get
    sandbox violations in src_test(). Second, it was broken anyways, as it
    used $TARGET which is not defined in src_test() (only in python_test()).


I wonder if you could clarify how you avoided the sandbox violations, and close this ticket if it's no longer relevant?
Comment 4 Florian Schmaus gentoo-dev 2024-06-29 08:34:58 UTC
(In reply to Eli Schwartz from comment #3)
> I wonder if you could clarify how you avoided the sandbox violations, and
> close this ticket if it's no longer relevant?

As I wrote in the commit message, I do not get any sandbox violations, so no explicit action to avoid those was required:

>>> Test phase: net-analyzer/greenbone-feed-sync-24.3.0-r1
 * python3_12: running distutils-r1_run_phase python_test
python3.12 -m unittest discover -v
test_config_file (tests.test_config.ConfigTestCase.test_config_file) ... ok
test_defaults (tests.test_config.ConfigTestCase.test_defaults) ... ok
test_destination_prefix (tests.test_config.ConfigTestCase.test_destination_prefix) ... ok
test_environment (tests.test_config.ConfigTestCase.test_environment) ... ok
test_environment_overrides_config_file (tests.test_config.ConfigTestCase.test_environment_overrides_config_file) ... ok
test_feed_url (tests.test_config.ConfigTestCase.test_feed_url) ... ok
test_getitem (tests.test_config.ConfigTestCase.test_getitem) ... ok
test_invalid_toml (tests.test_config.ConfigTestCase.test_invalid_toml) ... ok
test_load_ioerror (tests.test_config.ConfigTestCase.test_load_ioerror) ... ok
test_setitem (tests.test_config.ConfigTestCase.test_setitem) ... ok
test_feed_url (tests.test_config.EnterpriseSettingsTestCase.test_feed_url) ... ok
test_from_key (tests.test_config.EnterpriseSettingsTestCase.test_from_key) ... ok
test_change (tests.test_helper.ChangeUserAndGroupTestCase.test_change) ... ok
test_change_with_unknown_group (tests.test_helper.ChangeUserAndGroupTestCase.test_change_with_unknown_group) ... ok
test_change_with_unknown_user (tests.test_helper.ChangeUserAndGroupTestCase.test_change_with_unknown_user) ... ok
test_can_not_create_parent_dirs (tests.test_helper.FlockTestCase.test_can_not_create_parent_dirs) ... ok
test_console_output (tests.test_helper.FlockTestCase.test_console_output) ... ok
test_lock_failure (tests.test_helper.FlockTestCase.test_lock_failure) ... ok
test_lock_other_failure (tests.test_helper.FlockTestCase.test_lock_other_failure) ... ok
test_locking (tests.test_helper.FlockTestCase.test_locking) ... ok
test_permission_error (tests.test_helper.FlockTestCase.test_permission_error) ... ok
test_retry (tests.test_helper.FlockTestCase.test_retry) ... ok
test_unlock_oserror (tests.test_helper.FlockTestCase.test_unlock_oserror) ... ok
test_not_root (tests.test_helper.IsRootTestCase.test_not_root) ... ok
test_root (tests.test_helper.IsRootTestCase.test_root) ... ok
test_context_manager (tests.test_helper.SpinnerTestCase.test_context_manager) ... ok
test_render (tests.test_helper.SpinnerTestCase.test_render) ... ok
test_do_selftest_rsync_fail (tests.test_main.DoSelftestTestCase.test_do_selftest_rsync_fail) ... ok
test_do_selftest_success (tests.test_main.DoSelftestTestCase.test_do_selftest_success) ... ok
test_filter_syncs (tests.test_main.FilterSyncsTestCase.test_filter_syncs) ... ok
test_argument_takes_precedence (tests.test_parser.CliParserTestCase.test_argument_takes_precedence) ... ok
test_cert_data_destination (tests.test_parser.CliParserTestCase.test_cert_data_destination) ... ok
test_cert_data_url (tests.test_parser.CliParserTestCase.test_cert_data_url) ... ok
test_compression_level (tests.test_parser.CliParserTestCase.test_compression_level) ... ok
test_config (tests.test_parser.CliParserTestCase.test_config) ... ok
test_config_file_not_exists (tests.test_parser.CliParserTestCase.test_config_file_not_exists) ... ok
test_defaults (tests.test_parser.CliParserTestCase.test_defaults) ... ok
test_environment_takes_precedence (tests.test_parser.CliParserTestCase.test_environment_takes_precedence) ... ok
test_fail_fast (tests.test_parser.CliParserTestCase.test_fail_fast) ... ok
test_feed_url_from_enterprise_feed_key (tests.test_parser.CliParserTestCase.test_feed_url_from_enterprise_feed_key) ... ok
test_from_environment (tests.test_parser.CliParserTestCase.test_from_environment) ... ok
test_greenbone_cert_data_sync (tests.test_parser.CliParserTestCase.test_greenbone_cert_data_sync) ... ok
test_greenbone_enterprise_feed_key (tests.test_parser.CliParserTestCase.test_greenbone_enterprise_feed_key) ... ok
test_greenbone_nvt_sync (tests.test_parser.CliParserTestCase.test_greenbone_nvt_sync) ... ok
test_greenbone_scap_data_sync (tests.test_parser.CliParserTestCase.test_greenbone_scap_data_sync) ... ok
test_group (tests.test_parser.CliParserTestCase.test_group) ... ok
test_gvmd_data_destination (tests.test_parser.CliParserTestCase.test_gvmd_data_destination) ... ok
test_gvmd_data_url (tests.test_parser.CliParserTestCase.test_gvmd_data_url) ... ok
test_gvmd_lock_file (tests.test_parser.CliParserTestCase.test_gvmd_lock_file) ... ok
test_help (tests.test_parser.CliParserTestCase.test_help) ... ok
test_ignore_non_existing_enterprise_feed_key (tests.test_parser.CliParserTestCase.test_ignore_non_existing_enterprise_feed_key) ... ok
test_load_from_default_config (tests.test_parser.CliParserTestCase.test_load_from_default_config) ... ok
test_nasl_destination (tests.test_parser.CliParserTestCase.test_nasl_destination) ... ok
test_nasl_url (tests.test_parser.CliParserTestCase.test_nasl_url) ... ok
test_no_wait (tests.test_parser.CliParserTestCase.test_no_wait) ... ok
test_notus_destination (tests.test_parser.CliParserTestCase.test_notus_destination) ... ok
test_notus_url (tests.test_parser.CliParserTestCase.test_notus_url) ... ok
test_openvas_lock_file (tests.test_parser.CliParserTestCase.test_openvas_lock_file) ... ok
test_other (tests.test_parser.CliParserTestCase.test_other) ... ok
test_output_group (tests.test_parser.CliParserTestCase.test_output_group) ... ok
test_port_lists_destination (tests.test_parser.CliParserTestCase.test_port_lists_destination) ... ok
test_port_lists_url (tests.test_parser.CliParserTestCase.test_port_lists_url) ... ok
test_private_directory (tests.test_parser.CliParserTestCase.test_private_directory) ... ok
test_quiet (tests.test_parser.CliParserTestCase.test_quiet) ... ok
test_report_formats_destination (tests.test_parser.CliParserTestCase.test_report_formats_destination) ... ok
test_report_formats_url (tests.test_parser.CliParserTestCase.test_report_formats_url) ... ok
test_rsync_timeout (tests.test_parser.CliParserTestCase.test_rsync_timeout) ... ok
test_scan_configs_destination (tests.test_parser.CliParserTestCase.test_scan_configs_destination) ... ok
test_scan_configs_url (tests.test_parser.CliParserTestCase.test_scan_configs_url) ... ok
test_scap_data_destination (tests.test_parser.CliParserTestCase.test_scap_data_destination) ... ok
test_scap_data_url (tests.test_parser.CliParserTestCase.test_scap_data_url) ... ok
test_selftest (tests.test_parser.CliParserTestCase.test_selftest) ... ok
test_type (tests.test_parser.CliParserTestCase.test_type) ... ok
test_use_default_config_files (tests.test_parser.CliParserTestCase.test_use_default_config_files) ... ok
test_user (tests.test_parser.CliParserTestCase.test_user) ... ok
test_verbose (tests.test_parser.CliParserTestCase.test_verbose) ... ok
test_wait_group (tests.test_parser.CliParserTestCase.test_wait_group) ... ok
test_wait_interval (tests.test_parser.CliParserTestCase.test_wait_interval) ... ok
test_gvmd_data (tests.test_parser.FeedTypeTestCase.test_gvmd_data) ... ok
test_nvt (tests.test_parser.FeedTypeTestCase.test_nvt) ... ok
test_port_list (tests.test_parser.FeedTypeTestCase.test_port_list) ... ok
test_report_format (tests.test_parser.FeedTypeTestCase.test_report_format) ... ok
test_scan_config (tests.test_parser.FeedTypeTestCase.test_scan_config) ... ok
test_failure (tests.test_rsync.ExecRsyncTestCase.test_failure) ... ok
test_rsync_with_ssh (tests.test_rsync.ExecRsyncTestCase.test_rsync_with_ssh) ... ok
test_rsync_with_timeout (tests.test_rsync.ExecRsyncTestCase.test_rsync_with_timeout) ... ok
test_success (tests.test_rsync.ExecRsyncTestCase.test_success) ... ok
test_rsync_with_compression_level (tests.test_rsync.RsyncTestCase.test_rsync_with_compression_level) ... ok
test_rsync_with_defaults (tests.test_rsync.RsyncTestCase.test_rsync_with_defaults) ... ok
test_rsync_with_exclude (tests.test_rsync.RsyncTestCase.test_rsync_with_exclude) ... ok
test_rsync_with_private_subdir (tests.test_rsync.RsyncTestCase.test_rsync_with_private_subdir) ... ok
test_rsync_with_verbose (tests.test_rsync.RsyncTestCase.test_rsync_with_verbose) ... ok

----------------------------------------------------------------------
Ran 92 tests in 0.793s

OK
>>> Completed testing net-analyzer/greenbone-feed-sync-24.3.0-r1

Do you get sandbox violations? Guiseppe, how about you?
Comment 5 Giuseppe Foti 2024-07-03 05:38:43 UTC
> OK
> >>> Completed testing net-analyzer/greenbone-feed-sync-24.3.0-r1
> 
> Do you get sandbox violations? Guiseppe, how about you?

Yes Flow in my lto container I got the same errors reported in this bug.

To fix tests I need to patch the ebuild as in lines 39-46 of

https://github.com/gentoo/gentoo/commit/dfe695dd7d07df54c4248fbe91b132ccfce1a88f#diff-820b1f52c07bf23f49453b92a5d1788547d9d81a96f28ac89f436bf8caa44ee4R39-R46
Comment 6 Florian Schmaus gentoo-dev 2024-07-03 07:30:21 UTC
(In reply to Giuseppe Foti from comment #5)
> > OK
> > >>> Completed testing net-analyzer/greenbone-feed-sync-24.3.0-r1
> > 
> > Do you get sandbox violations? Guiseppe, how about you?
> 
> Yes Flow in my lto container I got the same errors reported in this bug.

Could this be lto related? Then we could consider patching it conditionally. Could you check if the tests succeed without lto?
Comment 7 Florian Schmaus gentoo-dev 2024-07-03 07:33:18 UTC
Oh, this patch does not disable tests, then we could even patch unconditionally. But if it is found to be lto-related then there should be a comment that this is required for the tests to succeed on lto systems.

[My gut feeling is that there could be something else, besides lto at play]
Comment 8 Giuseppe Foti 2024-07-04 06:02:42 UTC
(In reply to Florian Schmaus from comment #7)
> Oh, this patch does not disable tests, then we could even patch
> unconditionally. But if it is found to be lto-related then there should be a
> comment that this is required for the tests to succeed on lto systems.
> 
> [My gut feeling is that there could be something else, besides lto at play]

I think the problem is unrelated to lto.

I have the same issue in both of mine container.
One has
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
FFLAGS="${CFLAGS}"
FCFLAGS="${CFLAGS}"

and the other:
CFLAGS="-march=native -O2 -pipe -flto=7"
CXXFLAGS="${CFLAGS}"
FFLAGS="${CFLAGS}"
FCFLAGS="${CFLAGS}"

The problem seems the attempt to access /install/etc/gvm/greenbone-feed-sync.toml and /etc/gvm/greenbone-feed-sync.toml from the ebuild environment, during tests.

However, tests pass without patch in my host machine where those are run with just one python target (python3.12) in global scope.

So I think the problem appears when tests are run against more python versions at the same time (in my containers, I have
PYTHON_TARGETS="
pypy3 
python3_10 
python3_11
python3_12
python3_13
"
(greenbone-feed-sync runs tests with pypy3, python3_10, python3_11, python3_12)
Comment 9 Florian Schmaus gentoo-dev 2024-07-04 06:51:11 UTC
(In reply to Giuseppe Foti from comment #8)
> So I think the problem appears when tests are run against more python
> versions at the same time

Yep, that's most likely it.
Comment 10 Florian Schmaus gentoo-dev 2024-07-04 08:06:19 UTC
(In reply to Florian Schmaus from comment #9)
> (In reply to Giuseppe Foti from comment #8)
> > So I think the problem appears when tests are run against more python
> > versions at the same time
> 
> Yep, that's most likely it.

Correction, tests pass for me as well if I enable multiple python versions:

Test phase: net-analyzer/greenbone-feed-sync-24.3.0-r1
 * python3_11: running distutils-r1_run_phase python_test
python3.11 -m unittest_or_fail discover -v
test_config_file (tests.test_config.ConfigTestCase.test_config_file) ... ok
…
test_rsync_with_verbose (tests.test_rsync.RsyncTestCase.test_rsync_with_verbose) ... ok

----------------------------------------------------------------------
Ran 92 tests in 0.849s

OK
 * python3_12: running distutils-r1_run_phase python_test
python3.12 -m unittest discover -v
test_config_file (tests.test_config.ConfigTestCase.test_config_file) ... ok
…
test_rsync_with_verbose (tests.test_rsync.RsyncTestCase.test_rsync_with_verbose) ... ok

----------------------------------------------------------------------
Ran 92 tests in 1.117s

OK
Completed testing net-analyzer/greenbone-feed-sync-24.3.0-r1


I think the problem is that on the systems where the tests are failing, there are two files
- /etc/gvm/greenbone-feed-sync.toml
- /etc/gvm/greenbone-enterprise-feed-key

that are not accessable by the user running src_test ('portage' in most cases). It's not even a sandbox violation --- the previously existing comment in the ebuild was probably a red herring --- simply a matter of missing unix file permissions.
Comment 11 Larry the Git Cow gentoo-dev 2024-07-04 08:25:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fb919b834b2ff3f0cdcbdd94402fd5e76dd7e50

commit 1fb919b834b2ff3f0cdcbdd94402fd5e76dd7e50
Author:     Florian Schmaus <flow@gentoo.org>
AuthorDate: 2024-07-04 08:07:16 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2024-07-04 08:21:16 +0000

    net-analyzer/greenbone-feed-sync: revert "drop config file patching in src_test"
    
    This essentially reverts commit 0375a7b2b589d7ffe2b73a3426d8c0abd4f4b38e, but
    adjusts the sed comment to remove the reference to sandbox violations,
    because this are not what we are seeing without the sed.
    
    We also now use T to store config.py.orig, as it brings down the line
    length.
    
    Furthermore, we keep the "${WORKDIR}/${P}"/ part dropped, as it is
    unnecessary.
    
    Closes: https://bugs.gentoo.org/932836
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 .../greenbone-feed-sync-24.3.0-r1.ebuild                    | 13 +++++++++++++
 1 file changed, 13 insertions(+)