Starting lpcraft, version 0.0.43 Logging execution to '/home/buildd/.local/state/lpcraft/log/lpcraft-20230203-023403.267031.log' Launching environment for focal/amd64 Running ['apt', 'update'] :: :: WARNING: apt does not have a stable CLI interface. Use with caution in scripts. :: :: Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease :: Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease :: Hit:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease :: Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease :: Reading package lists... :: Building dependency tree... :: Reading state information... :: 94 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 94 not upgraded. Running command for the job... Running ['bash', '--noprofile', '--norc', '-ec', 'tox -e unit\n'] :: unit create: /build/lpcraft/project/.tox/unit :: unit installdeps: -r/build/lpcraft/project/tests/unit/requirements.txt, -r/build/lpcraft/project/requirements.txt :: unit installed: attrs==22.2.0,charmhelpers==1.2.1,charms.reactive==1.5.1,coverage==7.1.0,exceptiongroup==1.1.0,freezegun==1.2.2,iniconfig==2.0.0,Jinja2==3.1.2,MarkupSafe==2.1.2,mock==5.0.1,netaddr==0.8.0,packaging==23.0,pbr==5.11.1,pluggy==1.0.0,psutil==5.9.4,pyaml==21.10.1,pytest==7.2.1,pytest-cov==4.0.0,python-dateutil==2.8.2,PyYAML==6.0,six==1.16.0,tomli==2.0.1 :: unit run-test-pre: PYTHONHASHSEED='3022373905' :: unit run-test: commands[0] | pytest --ignore /build/lpcraft/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-7.2.1, pluggy-1.0.0 -- /build/lpcraft/project/.tox/unit/bin/python :: cachedir: .tox/unit/.pytest_cache :: rootdir: /build/lpcraft/project, configfile: pytest.ini :: plugins: cov-4.0.0 :: collecting ... collected 89 items :: :: tests/unit/test_content_cache.py::TestCharm::test_allocated_ports PASSED [ 1%] :: tests/unit/test_content_cache.py::TestCharm::test_check_haproxy_alerts PASSED [ 2%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_no_sites PASSED [ 3%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_ports_management PASSED [ 4%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_processes_and_threads PASSED [ 5%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_processes_and_threads_2 PASSED [ 6%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_sites PASSED [ 7%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_sites_auto_maxconns PASSED [ 8%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_sites_backup PASSED [ 10%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_sites_load_balancing_algorithm PASSED [ 11%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_sites_no_extra_stanzas PASSED [ 12%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_haproxy_sites_srv PASSED [ 13%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nagios PASSED [ 14%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nagios_token PASSED [ 15%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nginx_cache_config PASSED [ 16%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nginx_metrics_sites PASSED [ 17%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nginx_no_sites PASSED [ 19%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nginx_reuseport PASSED [ 20%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nginx_sites PASSED [ 21%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_nginx_sites_secrets PASSED [ 22%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_sysctl PASSED [ 23%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_sysctl_all PASSED [ 24%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_sysctl_default_qdisc PASSED [ 25%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_sysctl_tcp_congestion_control PASSED [ 26%] :: tests/unit/test_content_cache.py::TestCharm::test_configure_sysctl_tcp_mem PASSED [ 28%] :: tests/unit/test_content_cache.py::TestCharm::test_copy_file PASSED [ 29%] :: tests/unit/test_content_cache.py::TestCharm::test_copy_file_ownership PASSED [ 30%] :: tests/unit/test_content_cache.py::TestCharm::test_fire_stats_hook PASSED [ 31%] :: tests/unit/test_content_cache.py::TestCharm::test_hook_config_changed_flags PASSED [ 32%] :: tests/unit/test_content_cache.py::TestCharm::test_hook_install_flags PASSED [ 33%] :: tests/unit/test_content_cache.py::TestCharm::test_hook_install_packages PASSED [ 34%] :: tests/unit/test_content_cache.py::TestCharm::test_hook_set_active PASSED [ 35%] :: tests/unit/test_content_cache.py::TestCharm::test_hook_upgrade_charm_flags PASSED [ 37%] :: tests/unit/test_content_cache.py::TestCharm::test_interpolate_secrets PASSED [ 38%] :: tests/unit/test_content_cache.py::TestCharm::test_secrets_from_config PASSED [ 39%] :: tests/unit/test_content_cache.py::TestCharm::test_service_start_or_reload_running PASSED [ 40%] :: tests/unit/test_content_cache.py::TestCharm::test_service_start_or_reload_stopped PASSED [ 41%] :: tests/unit/test_content_cache.py::TestCharm::test_sites_from_config PASSED [ 42%] :: tests/unit/test_content_cache.py::TestCharm::test_sites_from_config_blacklist_ports PASSED [ 43%] :: tests/unit/test_content_cache.py::TestCharm::test_sites_from_config_no_reshuffling PASSED [ 44%] :: tests/unit/test_content_cache.py::TestCharm::test_stop_nginx PASSED [ 46%] :: tests/unit/test_content_cache.py::TestCharm::test_update_logrotate PASSED [ 47%] :: tests/unit/test_content_cache.py::TestCharm::test_write_file PASSED [ 48%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_calculate_num_procs_threads PASSED [ 49%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_get_parent_pid PASSED [ 50%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_file PASSED [ 51%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_generate_stanza_names PASSED [ 52%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_merge_listen_stanzas PASSED [ 53%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_monitoring_password PASSED [ 55%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_path PASSED [ 56%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_rendered_backend_stanzas PASSED [ 57%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_rendered_backend_stanzas_token PASSED [ 58%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_rendered_backend_stanzas_use_dns PASSED [ 59%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_rendered_full_config PASSED [ 60%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_rendered_listen_stanzas PASSED [ 61%] :: tests/unit/test_haproxy.py::TestLibHAProxy::test_haproxy_config_rendered_listen_stanzas_no_extra_stanzas PASSED [ 62%] :: 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_save_server_state PASSED [ 68%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx__process_extra_configs PASSED [ 69%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_conf_path PASSED [ 70%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_render PASSED [ 71%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_render_with_metrics PASSED [ 73%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_set_workers PASSED [ 74%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_sites_path PASSED [ 75%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_sync_sites PASSED [ 76%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_toggle_metrics_site PASSED [ 77%] :: tests/unit/test_nginx.py::TestLibNginx::test_nginx_config_write_sites PASSED [ 78%] :: tests/unit/test_utils.py::TestLibUtils::test_cache_max_size PASSED [ 79%] :: tests/unit/test_utils.py::TestLibUtils::test_dns_servers PASSED [ 80%] :: tests/unit/test_utils.py::TestLibUtils::test_generate_nagios_check_name PASSED [ 82%] :: tests/unit/test_utils.py::TestLibUtils::test_generate_token PASSED [ 83%] :: tests/unit/test_utils.py::TestLibUtils::test_generate_uri PASSED [ 84%] :: tests/unit/test_utils.py::TestLibUtils::test_invalid_firewall_config PASSED [ 85%] :: tests/unit/test_utils.py::TestLibUtils::test_ip_addr_port_split_ipv4 PASSED [ 86%] :: tests/unit/test_utils.py::TestLibUtils::test_ip_addr_port_split_ipv6 PASSED [ 87%] :: tests/unit/test_utils.py::TestLibUtils::test_logrotate PASSED [ 88%] :: tests/unit/test_utils.py::TestLibUtils::test_never_expires_time PASSED [ 89%] :: 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_tls_cipher_suites PASSED [ 98%] :: 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 285 0 110 0 100% :: lib/nginx.py 189 0 62 0 100% :: lib/utils.py 191 0 78 0 100% :: reactive/content_cache.py 531 55 198 6 89% 294-295, 317->319, 333->336, 367-368, 535-543, 565-597, 601-602, 606-615, 656, 734, 745 :: ----------------------------------------------------------------------- :: TOTAL 1196 55 448 6 95% :: Coverage HTML written to dir htmlcov :: :: :: ============================== 89 passed in 2.65s ============================== :: /build/lpcraft/project/.tox/unit/lib/python3.8/site-packages/coverage/inorout.py:507: 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 :)