Starting lpci, version 0.2.6 Logging execution to '/home/buildd/.local/state/lpci/log/lpci-20240315-230334.732528.log' Launching environment for focal/amd64 Starting instance Running ['apt', 'update'] :: :: WARNING: apt does not have a stable CLI interface. Use with caution in scripts. :: :: Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease :: Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease :: Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease :: Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease :: Reading package lists... :: Building dependency tree... :: Reading state information... :: 100 packages can be upgraded. Run 'apt list --upgradable' to see them. Installing system packages Running ['apt', 'install', '-y', 'tox'] :: :: WARNING: apt does not have a stable CLI interface. Use with caution in scripts. :: :: Reading package lists... :: Building dependency tree... :: Reading state information... :: tox is already the newest version (3.13.2-2). :: 0 upgraded, 0 newly installed, 0 to remove and 100 not upgraded. Running command for the job... Running ['bash', '--noprofile', '--norc', '-ec', 'tox -e unit\n'] :: unit create: /build/lpci/project/.tox/unit :: unit installdeps: -r/build/lpci/project/tests/unit/requirements.txt, -r/build/lpci/project/requirements.txt :: unit installed: charmhelpers==1.2.1,charms.reactive==1.5.2,coverage==7.4.4,exceptiongroup==1.2.0,freezegun==1.4.0,iniconfig==2.0.0,Jinja2==3.1.3,looseversion==1.3.0,MarkupSafe==2.1.5,mock==5.1.0,netaddr==1.2.1,packaging==24.0,pbr==6.0.0,pluggy==1.4.0,psutil==5.9.8,pyaml==23.12.0,pytest==8.1.1,pytest-cov==4.1.0,python-dateutil==2.9.0.post0,PyYAML==6.0.1,six==1.16.0,tomli==2.0.1 :: unit run-test-pre: PYTHONHASHSEED='3542838862' :: unit run-test: commands[0] | pytest --ignore /build/lpci/project/tests/integration -v --cov=lib --cov=reactive --cov=actions --cov-branch --cov-report=term-missing --cov-report=html :: ============================= test session starts ============================== :: platform linux -- Python 3.8.10, pytest-8.1.1, pluggy-1.4.0 -- /build/lpci/project/.tox/unit/bin/python :: cachedir: .tox/unit/.pytest_cache :: rootdir: /build/lpci/project :: configfile: pytest.ini :: plugins: cov-4.1.0 :: collecting ... collected 105 items :: :: tests/unit/test_content_cache.py::TestCharm::test_allocated_ports PASSED [ 0%] :: tests/unit/test_content_cache.py::TestCharm::test_check_haproxy_alerts PASSED [ 1%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_firewall PASSED [ 2%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_firewall_disabled PASSED [ 3%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_firewall_empty_blocked_ips PASSED [ 4%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_no_sites PASSED [ 5%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_ports_management PASSED [ 6%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_processes_and_threads PASSED [ 7%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_processes_and_threads_2 PASSED [ 8%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_sites PASSED [ 9%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_sites_auto_maxconns PASSED [ 10%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_sites_backup PASSED [ 11%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_sites_load_balancing_algorithm PASSED [ 12%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_sites_no_extra_stanzas PASSED [ 13%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_sites_override_maxconns PASSED [ 14%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_sites_rate_limiting PASSED [ 15%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_sites_srv PASSED [ 16%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nagios PASSED [ 17%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nagios_backend_check_path PASSED [ 18%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nagios_token PASSED [ 19%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nginx_cache_config PASSED [ 20%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nginx_metrics_sites PASSED [ 20%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nginx_no_sites PASSED [ 21%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nginx_reuseport PASSED [ 22%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nginx_sites PASSED [ 23%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nginx_sites_secrets PASSED [ 24%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nginx_worker_rlimit_nofile PASSED [ 25%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_sysctl PASSED [ 26%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_sysctl_all PASSED [ 27%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_sysctl_default_qdisc PASSED [ 28%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_sysctl_nf_conntrack_max PASSED [ 29%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_sysctl_somaxconn PASSED [ 30%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_sysctl_tcp_congestion_control PASSED [ 31%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_sysctl_tcp_mem PASSED [ 32%] :: tests/unit/test_content_cache.py::TestCharm::test_copy_file PASSED [ 33%] :: tests/unit/test_content_cache.py::TestCharm::test_copy_file_ownership PASSED [ 34%] :: tests/unit/test_content_cache.py::TestCharm::test_fire_stats_hook PASSED [ 35%] :: tests/unit/test_content_cache.py::TestCharm::test_hook_config_changed_firewall_flags PASSED [ 36%] :: tests/unit/test_content_cache.py::TestCharm::test_hook_config_changed_flags PASSED [ 37%] :: tests/unit/test_content_cache.py::TestCharm::test_hook_install_flags PASSED [ 38%] :: tests/unit/test_content_cache.py::TestCharm::test_hook_install_packages PASSED [ 39%] :: tests/unit/test_content_cache.py::TestCharm::test_hook_set_active PASSED [ 40%] :: tests/unit/test_content_cache.py::TestCharm::test_hook_upgrade_charm_flags PASSED [ 40%] :: tests/unit/test_content_cache.py::TestCharm::test_interpolate_secrets PASSED [ 41%] :: tests/unit/test_content_cache.py::TestCharm::test_secrets_from_config PASSED [ 42%] :: tests/unit/test_content_cache.py::TestCharm::test_service_start_or_reload_running PASSED [ 43%] :: tests/unit/test_content_cache.py::TestCharm::test_service_start_or_reload_stopped PASSED [ 44%] :: tests/unit/test_content_cache.py::TestCharm::test_sites_from_config PASSED [ 45%] :: tests/unit/test_content_cache.py::TestCharm::test_sites_from_config_blacklist_ports PASSED [ 46%] :: tests/unit/test_content_cache.py::TestCharm::test_sites_from_config_no_reshuffling PASSED [ 47%] :: tests/unit/test_content_cache.py::TestCharm::test_stop_nginx PASSED [ 48%] :: tests/unit/test_content_cache.py::TestCharm::test_update_logrotate PASSED [ 49%] :: tests/unit/test_content_cache.py::TestCharm::test_write_file PASSED [ 50%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_calculate_num_procs_threads PASSED [ 51%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_get_parent_pid PASSED [ 52%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_file PASSED [ 53%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_generate_stanza_names PASSED [ 54%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_merge_listen_stanzas PASSED [ 55%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_monitoring_password PASSED [ 56%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_path PASSED [ 57%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_rendered_backend_stanzas PASSED [ 58%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_rendered_backend_stanzas_override_backend_site PASSED [ 59%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_rendered_backend_stanzas_token PASSED [ 60%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_rendered_backend_stanzas_use_dns PASSED [ 60%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_rendered_full_config PASSED [ 61%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_rendered_listen_stanzas PASSED [ 62%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_rendered_listen_stanzas_no_extra_stanzas PASSED [ 63%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_rendered_listen_stanzas_redirect_default_site PASSED [ 64%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_write PASSED [ 65%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_increase_maxfds PASSED [ 66%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_increase_maxfds_cpe PASSED [ 67%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_remove_server_state PASSED [ 68%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_save_server_state PASSED [ 69%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx__process_extra_configs PASSED [ 70%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_conf_path PASSED [ 71%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_render PASSED [ 72%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_render_with_maps PASSED [ 73%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_render_with_metrics PASSED [ 74%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_set_worker_conf_rlimit_nofile PASSED [ 75%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_set_worker_confs PASSED [ 76%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_set_worker_confs_missing PASSED [ 77%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_sites_path PASSED [ 78%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_sync_sites PASSED [ 79%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_toggle_metrics_site PASSED [ 80%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_write_sites PASSED [ 80%] :: tests/unit/test_utils.py::TestLibUtils::test_cache_max_size PASSED [ 81%] :: tests/unit/test_utils.py::TestLibUtils::test_dns_servers PASSED [ 82%] :: tests/unit/test_utils.py::TestLibUtils::test_generate_nagios_check_name PASSED [ 83%] :: tests/unit/test_utils.py::TestLibUtils::test_generate_token PASSED [ 84%] :: tests/unit/test_utils.py::TestLibUtils::test_generate_uri PASSED [ 85%] :: tests/unit/test_utils.py::TestLibUtils::test_invalid_firewall_config PASSED [ 86%] :: tests/unit/test_utils.py::TestLibUtils::test_ip_addr_port_split_ipv4 PASSED [ 87%] :: tests/unit/test_utils.py::TestLibUtils::test_ip_addr_port_split_ipv6 PASSED [ 88%] :: tests/unit/test_utils.py::TestLibUtils::test_logrotate PASSED [ 89%] :: tests/unit/test_utils.py::TestLibUtils::test_never_expires_time PASSED [ 90%] :: tests/unit/test_utils.py::TestLibUtils::test_next_port_pair PASSED [ 91%] :: tests/unit/test_utils.py::TestLibUtils::test_next_port_pair_out_of_range PASSED [ 92%] :: tests/unit/test_utils.py::TestLibUtils::test_package_version PASSED [ 93%] :: tests/unit/test_utils.py::TestLibUtils::test_parse_default_firewall_config PASSED [ 94%] :: tests/unit/test_utils.py::TestLibUtils::test_parse_firewall_config PASSED [ 95%] :: tests/unit/test_utils.py::TestLibUtils::test_process_rlimits PASSED [ 96%] :: tests/unit/test_utils.py::TestLibUtils::test_select_tcp_congestion_control PASSED [ 97%] :: tests/unit/test_utils.py::TestLibUtils::test_systemd_override PASSED [ 98%] :: tests/unit/test_utils.py::TestLibUtils::test_tls_cipher_suites PASSED [ 99%] :: tests/unit/test_utils.py::TestLibUtils::test_tune_tcp_mem PASSED [100%] :: :: ---------- coverage: platform linux, python 3.8.10-final-0 ----------- :: Name Stmts Miss Branch BrPart Cover Missing :: ----------------------------------------------------------------------- :: lib/haproxy.py 318 2 122 0 99% 12-13 :: lib/nginx.py 211 0 74 0 100% :: lib/utils.py 203 0 82 0 100% :: reactive/content_cache.py 561 34 208 9 94% 299-300, 333->335, 349->352, 377-378, 575-583, 625-627, 631-632, 634-637, 646-647, 661-670, 711, 789, 800 :: ----------------------------------------------------------------------- :: TOTAL 1293 36 486 9 97% :: Coverage HTML written to dir htmlcov :: :: :: ============================= 105 passed in 3.42s ============================== :: /build/lpci/project/.tox/unit/lib/python3.8/site-packages/coverage/inorout.py:503: CoverageWarning: Module actions was never imported. (module-not-imported) :: self.warn(f"Module {pkg} was never imported.", slug="module-not-imported") :: ___________________________________ summary ____________________________________ :: unit: commands succeeded :: congratulations :)