weixin_39633807 2020-11-29 17:47
浏览 0

Complete framework unit test

|Wazuh version|Component|Install type|Install method|Platform| |---|---|---|---|---| | 3.9.2 | Framework unit test | Any | Any | Any |

Currently, the framework unit tests don't test all the code they should. The following shows the current status of the tests and their coverage:

Active Response


Name                                        Stmts   Miss  Cover   Missing
-------------------------------------------------------------------------
/wazuh/framework/wazuh/active_response.py      44     12    73%   11-19, 53, 62-64, 74

Agent


Name                              Stmts   Miss  Cover   Missing
---------------------------------------------------------------
/wazuh/framework/wazuh/agent.py    1394    952    32%   37-47, 87-93, 143-148, 159-163, 170-172, 179, 183, 187-188, 235, 238, 241-246, 290-325, 332-335, 339-340, 348-354, 364-377, 384-392, 404-416, 428-435, 467-468, 510-511, 534, 560-572, 591-615, 634-752, 764-780, 787-797, 835-837, 847-859, 874-877, 891-925, 936-947, 959, 971, 981-992, 1007-1026, 1042-1083, 1097-1101, 1114-1155, 1172-1173, 1185-1198, 1212-1217, 1232-1290, 1302-1309, 1321-1327, 1339-1348, 1365-1370, 1386, 1403-1442, 1454-1474, 1484-1501, 1510-1530, 1543-1586, 1600-1603, 1614-1639, 1650-1677, 1682-1687, 1692-1703, 1716-1736, 1750-1764, 1776-1782, 1794-1797, 1811-1833, 1845-1851, 1865-1875, 1904, 1926-1927, 1933-1938, 1942-1943, 1949-1950, 1964, 1975-1979, 1981, 1987, 1990, 1993-1994, 1999-2000, 2008-2013, 2020-2028, 2032, 2036-2037, 2042-2045, 2051, 2054, 2071, 2077, 2081, 2084-2094, 2096, 2103, 2107, 2109, 2113, 2116, 2118, 2124-2134, 2144, 2148, 2150, 2157, 2161, 2163, 2168, 2176, 2182, 2186, 2189, 2195, 2201, 2206, 2211, 2216, 2223-2226, 2238, 2245-2281, 2293, 2300-2409, 2416-2445, 2456-2459, 2469, 2496-2516, 2525-2529, 2539-2543, 2555-2558

Cdb_List


root:/wazuh/framework/wazuh/tests# coverage report -m
Name                                 Stmts   Miss  Cover   Missing
------------------------------------------------------------------
/wazuh/framework/wazuh/cdb_list.py      77      7    91%   91, 135-142

Common


Name                               Stmts   Miss  Cover   Missing
----------------------------------------------------------------
/wazuh/framework/wazuh/common.py      78      5    94%   15, 38-39, 115, 119

Decoders


Name                                Stmts   Miss  Cover   Missing
-----------------------------------------------------------------
/wazuh/framework/wazuh/decoder.py     141     21    85%   34, 49-53, 85, 95, 107, 114, 137-138, 178-179, 181-182, 184-185, 188, 218, 224-225

Groups


Name                              Stmts   Miss  Cover   Missing
---------------------------------------------------------------
/wazuh/framework/wazuh/agent.py    1394   1229    12%   37-47, 54-58, 62-78, 82-83, 87-93, 98-103, 106-132, 135-139, 142-150, 159-163, 170-172, 179, 183, 187-188, 215-235, 238, 241-246, 254-262, 269-276, 290-325, 332-335, 339-340, 348-354, 364-377, 384-392, 404-416, 428-435, 445-543, 560-572, 591-615, 634-752, 764-780, 787-797, 815-819, 835-837, 847-859, 874-877, 891-925, 936-947, 959, 971, 981-992, 1007-1026, 1042-1083, 1097-1101, 1114-1155, 1172-1173, 1185-1198, 1212-1217, 1232-1290, 1302-1309, 1321-1327, 1339-1348, 1365-1370, 1386, 1403-1442, 1454-1474, 1484-1501, 1510-1530, 1543-1586, 1600-1603, 1614-1639, 1650-1677, 1682-1687, 1692-1703, 1716-1736, 1750-1764, 1776-1782, 1794-1797, 1845-1851, 1865-1875, 1889-1908, 1912-1916, 1922-1952, 1960-2056, 2063-2168, 2175-2226, 2238, 2245-2281, 2293, 2300-2409, 2416-2445, 2456-2459, 2467-2476, 2486-2492, 2496-2516, 2525-2529, 2539-2543, 2555-2558

Manager


Name                                Stmts   Miss  Cover   Missing
-----------------------------------------------------------------
/wazuh/framework/wazuh/manager.py     320    130    59%   73, 105, 112, 119-122, 126, 132, 135-138, 152-182, 198, 203-206, 209, 213-216, 221-222, 251-256, 262-263, 269-272, 276-279, 290-316, 330, 334, 339-340, 350-359, 367-380, 423-424, 431-432, 447-462, 483-485, 493-494, 501-504, 510-511, 521-522, 531-532, 567

Rules


Name                             Stmts   Miss  Cover   Missing
--------------------------------------------------------------
/wazuh/framework/wazuh/rule.py     296     71    76%   41, 44-47, 50-53, 56-59, 62-65, 127-131, 142, 179, 189, 201, 208, 231-232, 271-273, 281-282, 284-285, 287-288, 290-291, 293-294, 296-297, 302-303, 305-306, 308-314, 317, 337-351, 471, 483, 485-488, 491-492, 527-528

SCA


Name                                                          Stmts   Miss  Cover   Missing
-------------------------------------------------------------------------------------------
/wazuh/framework/wazuh/security_configuration_assessment.py      81      4    95%   102, 104-105, 181

Syscheck


Name                                 Stmts   Miss  Cover   Missing
------------------------------------------------------------------
/wazuh/framework/wazuh/syscheck.py      78     50    36%   27-57, 68-78, 92-94, 99, 130-157

Util


/wazuh/framework/wazuh/utils.py     496    377    24%   30-45, 56-61, 72-91, 103-120, 133-167, 177-194, 208-228, 266-274, 284-309, 319-327, 338-346, 356-375, 379-383, 388-396, 400-409, 413-415, 419-425, 462-490, 494-515, 539, 541, 547, 551, 561, 570, 572-575, 596-608, 637-677, 681-688, 692, 696-708, 712-716, 720-731, 735, 749-766, 777-798, 802-807, 811-828, 832-843, 847-848, 852, 857, 862, 867-878, 886-895, 902-904, 911, 915, 920, 929, 933, 937-939, 943-946, 950, 960-962, 967-971, 975-977

WDB


Name                            Stmts   Miss  Cover   Missing
-------------------------------------------------------------
/wazuh/framework/wazuh/wdb.py      99     69    30%   42-56, 72, 81-96, 116-181

In addition to improving existing tests, it's necessary to create new tests for all code that does not have tests (syscollector, ciscat, exception, etc).

该提问来源于开源项目:wazuh/wazuh

  • 写回答

12条回答 默认 最新

  • weixin_39633807 2020-11-29 17:47
    关注

    Status update

    Summary

    I've finished the syscollector tests and I have started with the decoder tests. Current status of the tests and their coverage:

    Active Response

    
    Name                                        Stmts   Miss  Cover   Missing
    -------------------------------------------------------------------------
    /wazuh/framework/wazuh/active_response.py      44      0   100%
    

    Agent

    
    Name                              Stmts   Miss  Cover   Missing
    ---------------------------------------------------------------
    /wazuh/framework/wazuh/agent.py    1394    952    32%   37-47, 87-93, 143-148, 159-163, 170-172, 179, 183, 187-188, 235, 238, 241-246, 290-325, 332-335, 339-340, 348-354, 364-377, 384-392, 404-416, 428-435, 467-468, 510-511, 534, 560-572, 591-615, 634-752, 764-780, 787-797, 835-837, 847-859, 874-877, 891-925, 936-947, 959, 971, 981-992, 1007-1026, 1042-1083, 1097-1101, 1114-1155, 1172-1173, 1185-1198, 1212-1217, 1232-1290, 1302-1309, 1321-1327, 1339-1348, 1365-1370, 1386, 1403-1442, 1454-1474, 1484-1501, 1510-1530, 1543-1586, 1600-1603, 1614-1639, 1650-1677, 1682-1687, 1692-1703, 1716-1736, 1750-1764, 1776-1782, 1794-1797, 1811-1833, 1845-1851, 1865-1875, 1904, 1926-1927, 1933-1938, 1942-1943, 1949-1950, 1964, 1975-1979, 1981, 1987, 1990, 1993-1994, 1999-2000, 2008-2013, 2020-2028, 2032, 2036-2037, 2042-2045, 2051, 2054, 2071, 2077, 2081, 2084-2094, 2096, 2103, 2107, 2109, 2113, 2116, 2118, 2124-2134, 2144, 2148, 2150, 2157, 2161, 2163, 2168, 2176, 2182, 2186, 2189, 2195, 2201, 2206, 2211, 2216, 2223-2226, 2238, 2245-2281, 2293, 2300-2409, 2416-2445, 2456-2459, 2469, 2496-2516, 2525-2529, 2539-2543, 2555-2558
    

    Cdb_List

    
    root:/wazuh/framework/wazuh/tests# coverage report -m
    Name                                 Stmts   Miss  Cover   Missing
    ------------------------------------------------------------------
    /wazuh/framework/wazuh/cdb_list.py      77      7    91%   91, 135-142
    

    Common

    
    Name                                       Stmts   Miss  Cover   Missing
    ------------------------------------------------------------------------
    /wazuh/framework/wazuh/common.py      78      0   100%
    

    Decoders

    
    Name                                        Stmts   Miss  Cover   Missing
    -------------------------------------------------------------------------
    /wazuh/framework/wazuh/decoder.py     141      4    97%   49-53
    

    Groups

    
    Name                              Stmts   Miss  Cover   Missing
    ---------------------------------------------------------------
    /wazuh/framework/wazuh/agent.py    1394   1229    12%   37-47, 54-58, 62-78, 82-83, 87-93, 98-103, 106-132, 135-139, 142-150, 159-163, 170-172, 179, 183, 187-188, 215-235, 238, 241-246, 254-262, 269-276, 290-325, 332-335, 339-340, 348-354, 364-377, 384-392, 404-416, 428-435, 445-543, 560-572, 591-615, 634-752, 764-780, 787-797, 815-819, 835-837, 847-859, 874-877, 891-925, 936-947, 959, 971, 981-992, 1007-1026, 1042-1083, 1097-1101, 1114-1155, 1172-1173, 1185-1198, 1212-1217, 1232-1290, 1302-1309, 1321-1327, 1339-1348, 1365-1370, 1386, 1403-1442, 1454-1474, 1484-1501, 1510-1530, 1543-1586, 1600-1603, 1614-1639, 1650-1677, 1682-1687, 1692-1703, 1716-1736, 1750-1764, 1776-1782, 1794-1797, 1845-1851, 1865-1875, 1889-1908, 1912-1916, 1922-1952, 1960-2056, 2063-2168, 2175-2226, 2238, 2245-2281, 2293, 2300-2409, 2416-2445, 2456-2459, 2467-2476, 2486-2492, 2496-2516, 2525-2529, 2539-2543, 2555-2558
    

    Manager

    
    Name                                Stmts   Miss  Cover   Missing
    -----------------------------------------------------------------
    /wazuh/framework/wazuh/manager.py     320    130    59%   73, 105, 112, 119-122, 126, 132, 135-138, 152-182, 198, 203-206, 209, 213-216, 221-222, 251-256, 262-263, 269-272, 276-279, 290-316, 330, 334, 339-340, 350-359, 367-380, 423-424, 431-432, 447-462, 483-485, 493-494, 501-504, 510-511, 521-522, 531-532, 567
    

    Rules

    
    Name                             Stmts   Miss  Cover   Missing
    --------------------------------------------------------------
    /wazuh/framework/wazuh/rule.py     296     71    76%   41, 44-47, 50-53, 56-59, 62-65, 127-131, 142, 179, 189, 201, 208, 231-232, 271-273, 281-282, 284-285, 287-288, 290-291, 293-294, 296-297, 302-303, 305-306, 308-314, 317, 337-351, 471, 483, 485-488, 491-492, 527-528
    

    SCA

    
    Name                                                          Stmts   Miss  Cover   Missing
    -------------------------------------------------------------------------------------------
    /wazuh/framework/wazuh/security_configuration_assessment.py      81      4    95%   102, 104-105, 181
    

    Syscheck

    
    Name                                 Stmts   Miss  Cover   Missing
    ------------------------------------------------------------------
    /wazuh/framework/wazuh/syscheck.py      78     50    36%   27-57, 68-78, 92-94, 99, 130-157
    

    Syscollector

    
    Name                                             Stmts   Miss  Cover   Missing
    ------------------------------------------------------------------------------
    /wazuh/framework/wazuh/syscollector.py      90      0   100%
    

    Util

    
    /wazuh/framework/wazuh/utils.py     496    377    24%   30-45, 56-61, 72-91, 103-120, 133-167, 177-194, 208-228, 266-274, 284-309, 319-327, 338-346, 356-375, 379-383, 388-396, 400-409, 413-415, 419-425, 462-490, 494-515, 539, 541, 547, 551, 561, 570, 572-575, 596-608, 637-677, 681-688, 692, 696-708, 712-716, 720-731, 735, 749-766, 777-798, 802-807, 811-828, 832-843, 847-848, 852, 857, 862, 867-878, 886-895, 902-904, 911, 915, 920, 929, 933, 937-939, 943-946, 950, 960-962, 967-971, 975-977
    

    WDB

    
    Name                            Stmts   Miss  Cover   Missing
    -------------------------------------------------------------
    /wazuh/framework/wazuh/wdb.py      99     69    30%   42-56, 72, 81-96, 116-181
    

    Tasks

    • [1.5 h] First unit tests with pytest, mocking access to socket
    • [2.5 h] Modify class for dealing with new SQL model
    • [30 m] Debuggin

    Tests performed

    
    ================================================= test session starts =================================================
    platform linux -- Python 3.7.3, pytest-5.0.0, py-1.8.0, pluggy-0.12.0 -- /usr/bin/python3
    cachedir: .pytest_cache
    rootdir: /wazuh-manager/framework
    plugins: cov-2.7.1
    collected 314 items                                                                                                   
    
    test_active_response.py::test_get_commands PASSED                                                               [  0%]
    test_active_response.py::test_run_command[1650-000-None-arguments0-False] PASSED                                [  0%]
    test_active_response.py::test_run_command[1653-None-random-arguments1-False] PASSED                             [  0%]
    test_active_response.py::test_run_command[1655-000-invalid_cmd-arguments2-False] PASSED                         [  1%]
    test_active_response.py::test_run_command[1651-001-valid_cmd-arguments3-False] PASSED                           [  1%]
    test_active_response.py::test_run_command[None-001-valid_cmd-arguments4-False] PASSED                           [  1%]
    test_active_response.py::test_run_command[None-001-valid_cmd-arguments5-True] PASSED                            [  2%]
    test_active_response.py::test_run_command[None-001-valid_cmd-arguments6-False] PASSED                           [  2%]
    test_active_response.py::test_run_command[None-000-valid_cmd-arguments7-False] PASSED                           [  2%]
    test_active_response.py::test_run_command[None-all-valid_cmd-arguments8-False] PASSED                           [  3%]
    test_agent.py::test_get_agents_overview_default PASSED                                                          [  3%]
    test_agent.py::test_get_agents_overview_select[select0-all-None-0] PASSED                                       [  3%]
    test_agent.py::test_get_agents_overview_select[select1-all-None-1] PASSED                                       [  4%]
    test_agent.py::test_get_agents_overview_select[select2-all-None-1] PASSED                                       [  4%]
    test_agent.py::test_get_agents_overview_select[select3-Active,Pending-None-0] PASSED                            [  4%]
    test_agent.py::test_get_agents_overview_select[select4-Disconnected-None-1] PASSED                              [  5%]
    test_agent.py::test_get_agents_overview_select[select5-Disconnected-1s-1] PASSED                                [  5%]
    test_agent.py::test_get_agents_overview_select[select6-Disconnected-2h-0] PASSED                                [  5%]
    test_agent.py::test_get_agents_overview_select[select7-all-15m-2] PASSED                                        [  6%]
    test_agent.py::test_get_agents_overview_select[select8-Active-15m-0] PASSED                                     [  6%]
    test_agent.py::test_get_agents_overview_select[select9-Active,Pending-15m-1] PASSED                             [  6%]
    test_agent.py::test_get_agents_overview_select[select10-status10-15m-1] PASSED                                  [  7%]
    test_agent.py::test_get_agents_overview_query[ip=172.17.0.201] PASSED                                           [  7%]
    test_agent.py::test_get_agents_overview_query[ip=172.17.0.202] PASSED                                           [  7%]
    test_agent.py::test_get_agents_overview_query[ip=172.17.0.202;registerIP=any] PASSED                            [  7%]
    test_agent.py::test_get_agents_overview_query[status=Disconnected;lastKeepAlive>34m] PASSED                     [  8%]
    test_agent.py::test_get_agents_overview_query[(status=Active,status=Pending);lastKeepAlive>5m] PASSED           [  8%]
    test_agent.py::test_get_agents_overview_search[search0-3] PASSED                                                [  8%]
    test_agent.py::test_get_agents_overview_search[search1-3] PASSED                                                [  9%]
    test_agent.py::test_get_agents_overview_search[search2-1] PASSED                                                [  9%]
    test_agent.py::test_get_agents_overview_search[search3-5] PASSED                                                [  9%]
    test_agent.py::test_get_agents_overview_search[search4-2] PASSED                                                [ 10%]
    test_agent.py::test_get_agents_overview_status_olderthan[active-9m-1-None] PASSED                               [ 10%]
    test_agent.py::test_get_agents_overview_status_olderthan[all-1s-5-None] PASSED                                  [ 10%]
    test_agent.py::test_get_agents_overview_status_olderthan[pending,neverconnected-30m-1-None] PASSED              [ 11%]
    test_agent.py::test_get_agents_overview_status_olderthan[55-30m-0-1729] PASSED                                  [ 11%]
    test_agent.py::test_get_config_error[100-logcollector-internal-1701] PASSED                                     [ 11%]
    test_agent.py::test_get_config_error[005-logcollector-internal-1740] PASSED                                     [ 12%]
    test_agent.py::test_get_config_error[002-logcollector-internal-1735] PASSED                                     [ 12%]
    test_agent.py::test_get_config_error[000-None-None-1307] PASSED                                                 [ 12%]
    test_agent.py::test_get_config_error[000-random-random-1101] PASSED                                             [ 13%]
    test_agent.py::test_get_config_error[000-analysis-internal-1117] PASSED                                         [ 13%]
    test_agent.py::test_get_config_error[000-analysis-internal-1118] PASSED                                         [ 13%]
    test_agent.py::test_get_config_error[000-analysis-random-1116] PASSED                                           [ 14%]
    test_agent.py::test_get_config_error[000-analysis-internal-None] PASSED                                         [ 14%]
    test_agent.py::test_remove_manual[False] PASSED                                                                 [ 14%]
    test_agent.py::test_remove_manual[True] PASSED                                                                  [ 14%]
    test_agent.py::test_remove_manual_error[001-1746] PASSED                                                        [ 15%]
    test_agent.py::test_remove_manual_error[100-1701] PASSED                                                        [ 15%]
    test_agent.py::test_remove_manual_error[001-1600] PASSED                                                        [ 15%]
    test_agent.py::test_remove_manual_error[001-1748] PASSED                                                        [ 16%]
    test_agent.py::test_remove_manual_error[001-1747] PASSED                                                        [ 16%]
    test_agent.py::test_get_available_versions[001] PASSED                                                          [ 16%]
    test_agent.py::test_get_available_versions[002] PASSED                                                          [ 17%]
    test_agent.py::test_upgrade[001] PASSED                                                                         [ 17%]
    test_agent.py::test_upgrade[002] PASSED                                                                         [ 17%]
    test_agent.py::test_get_wpk_file[001] PASSED                                                                    [ 18%]
    test_agent.py::test_get_wpk_file[002] PASSED                                                                    [ 18%]
    test_agent.py::test_send_wpk_file[001] PASSED                                                                   [ 18%]
    test_agent.py::test_send_wpk_file[002] PASSED                                                                   [ 19%]
    test_agent.py::test_get_outdated_agents PASSED                                                                  [ 19%]
    test_cdb_list.py::TestCDBList::test_get_lists PASSED                                                            [ 19%]
    test_cdb_list.py::TestCDBList::test_get_lists_limit PASSED                                                      [ 20%]
    test_cdb_list.py::TestCDBList::test_get_lists_offset PASSED                                                     [ 20%]
    test_cdb_list.py::TestCDBList::test_get_lists_path PASSED                                                       [ 20%]
    test_cdb_list.py::TestCDBList::test_get_lists_search PASSED                                                     [ 21%]
    test_cdb_list.py::TestCDBList::test_get_lists_sort PASSED                                                       [ 21%]
    test_cdb_list.py::TestCDBList::test_get_path_lists PASSED                                                       [ 21%]
    test_cdb_list.py::TestCDBList::test_get_path_lists_limit PASSED                                                 [ 21%]
    test_cdb_list.py::TestCDBList::test_get_path_lists_offset PASSED                                                [ 22%]
    test_cdb_list.py::TestCDBList::test_get_path_lists_search PASSED                                                [ 22%]
    test_cdb_list.py::TestCDBList::test_get_path_lists_sort PASSED                                                  [ 22%]
    test_common.py::test_find_wazuh_path[/var/ossec/framework/python/lib/python3.7/site-packages/wazuh-3.10.0-py3.7.egg/wazuh-/var/ossec] PASSED [ 23%]
    test_common.py::test_find_wazuh_path[/my/custom/path/framework/python/lib/python3.7/site-packages/wazuh-3.10.0-py3.7.egg/wazuh-/my/custom/path] PASSED [ 23%]
    test_common.py::test_find_wazuh_path[/my/fake/path-] PASSED                                                     [ 23%]
    test_common.py::test_find_wazuh_path_relative_path PASSED                                                       [ 24%]
    test_common.py::test_ossec_uid PASSED                                                                           [ 24%]
    test_common.py::test_ossec_gid PASSED                                                                           [ 24%]
    test_common.py::test_load_metadata_from_file PASSED                                                             [ 25%]
    test_decoders.py::test_decoder__init__ PASSED                                                                   [ 25%]
    test_decoders.py::test_decoder__str__ PASSED                                                                    [ 25%]
    test_decoders.py::test_decoder_to_dict PASSED                                                                   [ 26%]
    test_decoders.py::test_add_detail[regex-w+-details0] PASSED                                                     [ 26%]
    test_decoders.py::test_add_detail[regex-w+-details1] PASSED                                                     [ 26%]
    test_decoders.py::test_add_detail[random-random-details2] PASSED                                                [ 27%]
    test_decoders.py::test_get_decoders_file_status[None-get_decoders_files] PASSED                                 [ 27%]
    test_decoders.py::test_get_decoders_file_status[None-get_decoders] PASSED                                       [ 27%]
    test_decoders.py::test_get_decoders_file_status[all-get_decoders_files] PASSED                                  [ 28%]
    test_decoders.py::test_get_decoders_file_status[all-get_decoders] PASSED                                        [ 28%]
    test_decoders.py::test_get_decoders_file_status[enabled-get_decoders_files] PASSED                              [ 28%]
    test_decoders.py::test_get_decoders_file_status[enabled-get_decoders] PASSED                                    [ 28%]
    test_decoders.py::test_get_decoders_file_status[disabled-get_decoders_files] PASSED                             [ 29%]
    test_decoders.py::test_get_decoders_file_status[disabled-get_decoders] PASSED                                   [ 29%]
    test_decoders.py::test_get_decoders_file_status[random-get_decoders_files] PASSED                               [ 29%]
    test_decoders.py::test_get_decoders_file_status[random-get_decoders] PASSED                                     [ 30%]
    test_decoders.py::test_get_decoders_file_path[None-get_decoders_files] PASSED                                   [ 30%]
    test_decoders.py::test_get_decoders_file_path[None-get_decoders] PASSED                                         [ 30%]
    test_decoders.py::test_get_decoders_file_path[ruleset/decoders-get_decoders_files] PASSED                       [ 31%]
    test_decoders.py::test_get_decoders_file_path[ruleset/decoders-get_decoders] PASSED                             [ 31%]
    test_decoders.py::test_get_decoders_file_path[random-get_decoders_files] PASSED                                 [ 31%]
    test_decoders.py::test_get_decoders_file_path[random-get_decoders] PASSED                                       [ 32%]
    test_decoders.py::test_get_decoders_file_pagination[0-0-get_decoders_files] PASSED                              [ 32%]
    test_decoders.py::test_get_decoders_file_pagination[0-0-get_decoders] PASSED                                    [ 32%]
    test_decoders.py::test_get_decoders_file_pagination[0-1-get_decoders_files] PASSED                              [ 33%]
    test_decoders.py::test_get_decoders_file_pagination[0-1-get_decoders] PASSED                                    [ 33%]
    test_decoders.py::test_get_decoders_file_pagination[0-500-get_decoders_files] PASSED                            [ 33%]
    test_decoders.py::test_get_decoders_file_pagination[0-500-get_decoders] PASSED                                  [ 34%]
    test_decoders.py::test_get_decoders_file_pagination[1-500-get_decoders_files] PASSED                            [ 34%]
    test_decoders.py::test_get_decoders_file_pagination[1-500-get_decoders] PASSED                                  [ 34%]
    test_decoders.py::test_get_decoders_file_pagination[2-500-get_decoders_files] PASSED                            [ 35%]
    test_decoders.py::test_get_decoders_file_pagination[2-500-get_decoders] PASSED                                  [ 35%]
    test_decoders.py::test_get_decoders_file_pagination[3-500-get_decoders_files] PASSED                            [ 35%]
    test_decoders.py::test_get_decoders_file_pagination[3-500-get_decoders] PASSED                                  [ 35%]
    test_decoders.py::test_get_decoders_file_sort[None-get_decoders_files] PASSED                                   [ 36%]
    test_decoders.py::test_get_decoders_file_sort[None-get_decoders] PASSED                                         [ 36%]
    test_decoders.py::test_get_decoders_file_sort[sort1-get_decoders_files] PASSED                                  [ 36%]
    test_decoders.py::test_get_decoders_file_sort[sort1-get_decoders] PASSED                                        [ 37%]
    test_decoders.py::test_get_decoders_file_sort[sort2-get_decoders_files] PASSED                                  [ 37%]
    test_decoders.py::test_get_decoders_file_sort[sort2-get_decoders] PASSED                                        [ 37%]
    test_decoders.py::test_get_decoders_file_search[None] PASSED                                                    [ 38%]
    test_decoders.py::test_get_decoders_file_search[search1] PASSED                                                 [ 38%]
    test_decoders.py::test_get_decoders_file_search[search2] PASSED                                                 [ 38%]
    test_decoders.py::test_private_get_files_empty_conf PASSED                                                      [ 39%]
    test_decoders.py::test_private_get_files_list_conf[mock_conf0] PASSED                                           [ 39%]
    test_decoders.py::test_private_get_files_list_conf[mock_conf1] PASSED                                           [ 39%]
    test_decoders.py::test_get_decoders_name[None-None] PASSED                                                      [ 40%]
    test_decoders.py::test_get_decoders_name[None-random] PASSED                                                    [ 40%]
    test_decoders.py::test_get_decoders_name[None-agent-buffer] PASSED                                              [ 40%]
    test_decoders.py::test_get_decoders_name[random-None] PASSED                                                    [ 41%]
    test_decoders.py::test_get_decoders_name[random-random] PASSED                                                  [ 41%]
    test_decoders.py::test_get_decoders_name[random-agent-buffer] PASSED                                            [ 41%]
    test_decoders.py::test_get_decoders_name[decoders1.xml-None] PASSED                                             [ 42%]
    test_decoders.py::test_get_decoders_name[decoders1.xml-random] PASSED                                           [ 42%]
    test_decoders.py::test_get_decoders_name[decoders1.xml-agent-buffer] PASSED                                     [ 42%]
    test_decoders.py::test_get_decoders_parents PASSED                                                              [ 42%]
    test_decoders.py::test_private_load_decoders_from_file PASSED                                                   [ 43%]
    test_decoders.py::test_private_load_decoders_from_file_exceptions PASSED                                        [ 43%]
    test_group.py::test_sucessfully_remove_single_group_agent[dmz-005-dmz-default] PASSED                           [ 43%]
    test_group.py::test_sucessfully_remove_single_group_agent[dmz,webserver-005-dmz-webserver] PASSED               [ 44%]
    test_group.py::test_sucessfully_remove_single_group_agent[dmz,webserver,database-005-dmz-webserver,database] PASSED [ 44%]
    test_group.py::test_sucessfully_remove_single_group_agent[dmz,default-005-default-dmz] PASSED                   [ 44%]
    test_group.py::test_failed_remove_single_group_agent[-005-dmz-1734] PASSED                                      [ 45%]
    test_group.py::test_failed_remove_single_group_agent[dmz-005-default-1734] PASSED                               [ 45%]
    test_group.py::test_failed_remove_single_group_agent[default-005-default-1745] PASSED                           [ 45%]
    test_group.py::test_failed_remove_single_group_agent[dmz-005-webserver,database-1734] PASSED                    [ 46%]
    test_manager.py::test_status[running] PASSED                                                                    [ 46%]
    test_manager.py::test_status[stopped] PASSED                                                                    [ 46%]
    test_manager.py::test_status[failed] PASSED                                                                     [ 47%]
    test_manager.py::test_status[restarting] PASSED                                                                 [ 47%]
    test_manager.py::test_status[starting] PASSED                                                                   [ 47%]
    test_manager.py::test_restart_ok PASSED                                                                         [ 48%]
    test_manager.py::test_upload_file[input_rules_file-output_rules_file] PASSED                                    [ 48%]
    test_manager.py::test_upload_file[input_decoders_file-output_decoders_file] PASSED                              [ 48%]
    test_manager.py::test_upload_file[input_lists_file-output_lists_file] PASSED                                    [ 49%]
    test_manager.py::test_restart_ko_socket PASSED                                                                  [ 49%]
    test_manager.py::test_get_file[input_rules_file] PASSED                                                         [ 49%]
    test_manager.py::test_get_file[input_decoders_file] PASSED                                                      [ 50%]
    test_manager.py::test_get_file[input_lists_file] PASSED                                                         [ 50%]
    test_manager.py::test_validation[0-] PASSED                                                                     [ 50%]
    test_manager.py::test_validation[1-2019/02/27 11:30:07 wazuh-clusterd: ERROR: [Cluster] [Main] Error 3004 - Error in cluster configuration: Unspecified key] PASSED [ 50%]
    test_manager.py::test_validation[1-2019/02/27 11:30:24 ossec-authd: ERROR: (1230): Invalid element in the configuration: 'use_source_i'.\n2019/02/27 11:30:24 ossec-authd: ERROR: (1202): Configuration error at '/var/ossec/etc/ossec.conf'.] PASSED [ 51%]
    test_manager.py::test_delete_file PASSED                                                                        [ 51%]
    test_manager.py::test_ossec_log[all-all-12] PASSED                                                              [ 51%]
    test_manager.py::test_ossec_log[wazuh-modulesd:database-all-2] PASSED                                           [ 52%]
    test_manager.py::test_ossec_log[wazuh-modulesd:syscollector-all-2] PASSED                                       [ 52%]
    test_manager.py::test_ossec_log[wazuh-modulesd:aws-s3-all-5] PASSED                                             [ 52%]
    test_manager.py::test_ossec_log[ossec-execd-all-1] PASSED                                                       [ 53%]
    test_manager.py::test_ossec_log[ossec-csyslogd-all-2] PASSED                                                    [ 53%]
    test_manager.py::test_ossec_log[random-all-0] PASSED                                                            [ 53%]
    test_manager.py::test_ossec_log[all-info-6] PASSED                                                              [ 54%]
    test_manager.py::test_ossec_log[all-error-2] PASSED                                                             [ 54%]
    test_manager.py::test_ossec_log[all-debug-2] PASSED                                                             [ 54%]
    test_manager.py::test_ossec_log[all-random-0] PASSED                                                            [ 55%]
    test_manager.py::test_ossec_log[all-warning-2] PASSED                                                           [ 55%]
    test_rules.py::test_get_rules_file_status[None-get_rules_files] PASSED                                          [ 55%]
    test_rules.py::test_get_rules_file_status[None-get_rules] PASSED                                                [ 56%]
    test_rules.py::test_get_rules_file_status[all-get_rules_files] PASSED                                           [ 56%]
    test_rules.py::test_get_rules_file_status[all-get_rules] PASSED                                                 [ 56%]
    test_rules.py::test_get_rules_file_status[enabled-get_rules_files] PASSED                                       [ 57%]
    test_rules.py::test_get_rules_file_status[enabled-get_rules] PASSED                                             [ 57%]
    test_rules.py::test_get_rules_file_status[disabled-get_rules_files] PASSED                                      [ 57%]
    test_rules.py::test_get_rules_file_status[disabled-get_rules] PASSED                                            [ 57%]
    test_rules.py::test_get_rules_file_status[random-get_rules_files] PASSED                                        [ 58%]
    test_rules.py::test_get_rules_file_status[random-get_rules] PASSED                                              [ 58%]
    test_rules.py::test_get_rules_file_path[None-get_rules_files] PASSED                                            [ 58%]
    test_rules.py::test_get_rules_file_path[None-get_rules] PASSED                                                  [ 59%]
    test_rules.py::test_get_rules_file_path[ruleset/rules-get_rules_files] PASSED                                   [ 59%]
    test_rules.py::test_get_rules_file_path[ruleset/rules-get_rules] PASSED                                         [ 59%]
    test_rules.py::test_get_rules_file_path[random-get_rules_files] PASSED                                          [ 60%]
    test_rules.py::test_get_rules_file_path[random-get_rules] PASSED                                                [ 60%]
    test_rules.py::test_get_rules_file_pagination[0-0-get_rules_files] PASSED                                       [ 60%]
    test_rules.py::test_get_rules_file_pagination[0-0-get_rules] PASSED                                             [ 61%]
    test_rules.py::test_get_rules_file_pagination[0-1-get_rules_files] PASSED                                       [ 61%]
    test_rules.py::test_get_rules_file_pagination[0-1-get_rules] PASSED                                             [ 61%]
    test_rules.py::test_get_rules_file_pagination[0-500-get_rules_files] PASSED                                     [ 62%]
    test_rules.py::test_get_rules_file_pagination[0-500-get_rules] PASSED                                           [ 62%]
    test_rules.py::test_get_rules_file_pagination[1-500-get_rules_files] PASSED                                     [ 62%]
    test_rules.py::test_get_rules_file_pagination[1-500-get_rules] PASSED                                           [ 63%]
    test_rules.py::test_get_rules_file_pagination[2-500-get_rules_files] PASSED                                     [ 63%]
    test_rules.py::test_get_rules_file_pagination[2-500-get_rules] PASSED                                           [ 63%]
    test_rules.py::test_get_rules_file_pagination[3-500-get_rules_files] PASSED                                     [ 64%]
    test_rules.py::test_get_rules_file_pagination[3-500-get_rules] PASSED                                           [ 64%]
    test_rules.py::test_get_rules_file_sort[None-get_rules_files] PASSED                                            [ 64%]
    test_rules.py::test_get_rules_file_sort[None-get_rules] PASSED                                                  [ 64%]
    test_rules.py::test_get_rules_file_sort[sort1-get_rules_files] PASSED                                           [ 65%]
    test_rules.py::test_get_rules_file_sort[sort1-get_rules] PASSED                                                 [ 65%]
    test_rules.py::test_get_rules_file_sort[sort2-get_rules_files] PASSED                                           [ 65%]
    test_rules.py::test_get_rules_file_sort[sort2-get_rules] PASSED                                                 [ 66%]
    test_rules.py::test_get_rules_file_search[None-get_rules_files] PASSED                                          [ 66%]
    test_rules.py::test_get_rules_file_search[None-get_rules] PASSED                                                [ 66%]
    test_rules.py::test_get_rules_file_search[search1-get_rules_files] PASSED                                       [ 67%]
    test_rules.py::test_get_rules_file_search[search1-get_rules] PASSED                                             [ 67%]
    test_rules.py::test_get_rules_file_search[search2-get_rules_files] PASSED                                       [ 67%]
    test_rules.py::test_get_rules_file_search[search2-get_rules] PASSED                                             [ 68%]
    test_rules.py::test_get_hipaa PASSED                                                                            [ 68%]
    test_rules.py::test_get_nist_800_53 PASSED                                                                      [ 68%]
    test_rules.py::test_get_gpg13 PASSED                                                                            [ 69%]
    test_rules.py::test_get_gdpr PASSED                                                                             [ 69%]
    test_rules.py::test_get_pci PASSED                                                                              [ 69%]
    test_rules.py::test_protected_get_requirement[pci-None-None] PASSED                                             [ 70%]
    test_rules.py::test_protected_get_requirement[pci-None-sort1] PASSED                                            [ 70%]
    test_rules.py::test_protected_get_requirement[pci-search1-None] PASSED                                          [ 70%]
    test_rules.py::test_protected_get_requirement[pci-search1-sort1] PASSED                                         [ 71%]
    test_rules.py::test_protected_get_requirement[gdpr-None-None] PASSED                                            [ 71%]
    test_rules.py::test_protected_get_requirement[gdpr-None-sort1] PASSED                                           [ 71%]
    test_rules.py::test_protected_get_requirement[gdpr-search1-None] PASSED                                         [ 71%]
    test_rules.py::test_protected_get_requirement[gdpr-search1-sort1] PASSED                                        [ 72%]
    test_rules.py::test_protected_get_requirement[gpg13-None-None] PASSED                                           [ 72%]
    test_rules.py::test_protected_get_requirement[gpg13-None-sort1] PASSED                                          [ 72%]
    test_rules.py::test_protected_get_requirement[gpg13-search1-None] PASSED                                        [ 73%]
    test_rules.py::test_protected_get_requirement[gpg13-search1-sort1] PASSED                                       [ 73%]
    test_rules.py::test_protected_get_requirement[wrong-None-None] PASSED                                           [ 73%]
    test_rules.py::test_protected_get_requirement[wrong-None-sort1] PASSED                                          [ 74%]
    test_rules.py::test_protected_get_requirement[wrong-search1-None] PASSED                                        [ 74%]
    test_rules.py::test_protected_get_requirement[wrong-search1-sort1] PASSED                                       [ 74%]
    test_rules.py::test_protected_get_requirement[hipaa-None-None] PASSED                                           [ 75%]
    test_rules.py::test_protected_get_requirement[hipaa-None-sort1] PASSED                                          [ 75%]
    test_rules.py::test_protected_get_requirement[hipaa-search1-None] PASSED                                        [ 75%]
    test_rules.py::test_protected_get_requirement[hipaa-search1-sort1] PASSED                                       [ 76%]
    test_rules.py::test_protected_get_requirement[nist-800-53-None-None] PASSED                                     [ 76%]
    test_rules.py::test_protected_get_requirement[nist-800-53-None-sort1] PASSED                                    [ 76%]
    test_rules.py::test_protected_get_requirement[nist-800-53-search1-None] PASSED                                  [ 77%]
    test_rules.py::test_protected_get_requirement[nist-800-53-search1-sort1] PASSED                                 [ 77%]
    test_security_configuration_assessment.py::TestPolicyMonitoring::test_get_sca_checks PASSED                     [ 77%]
    test_security_configuration_assessment.py::TestPolicyMonitoring::test_get_sca_list PASSED                       [ 78%]
    test_security_configuration_assessment.py::TestPolicyMonitoring::test_get_sca_list_search_param PASSED          [ 78%]
    test_security_configuration_assessment.py::TestPolicyMonitoring::test_get_sca_list_select_param PASSED          [ 78%]
    test_security_configuration_assessment.py::TestPolicyMonitoring::test_sca_checks_select_and_q PASSED            [ 78%]
    test_syscheck.py::test_last_scan[001-version0] PASSED                                                           [ 79%]
    test_syscheck.py::test_last_scan[002-version1] PASSED                                                           [ 79%]
    test_syscheck.py::test_last_scan[003-version2] PASSED                                                           [ 79%]
    test_syscheck.py::test_last_scan[004-version3] PASSED                                                           [ 80%]
    test_syscheck.py::test_last_scan[005-version4] PASSED                                                           [ 80%]
    test_syscheck.py::test_last_scan[006-version5] PASSED                                                           [ 80%]
    test_syscollector.py::test_get_item_agent[select0-valid_select_fields0-search0-True-response0-1] PASSED         [ 81%]
    test_syscollector.py::test_get_item_agent[select1-valid_select_fields1-search1-False-response1-0] PASSED        [ 81%]
    test_syscollector.py::test_get_item_agent[select2-valid_select_fields2-search2-False-response2-1] PASSED        [ 81%]
    test_syscollector.py::test_failed_get_item_agent[select0-valid_select_fields0-sort0-allowed_sort_fields0-1403] PASSED [ 82%]
    test_syscollector.py::test_failed_get_item_agent[select1-valid_select_fields1-sort1-allowed_sort_fields1-1724] PASSED [ 82%]
    test_syscollector.py::test_failed_get_item_agent[select2-valid_select_fields2-sort2-allowed_sort_fields2-1724] PASSED [ 82%]
    test_syscollector.py::test_get_agent_items_private[sort0-500-response0] PASSED                                  [ 83%]
    test_syscollector.py::test_get_agent_items_private[sort1-500-response1] PASSED                                  [ 83%]
    test_syscollector.py::test_get_agent_items_private[sort2-1-response2] PASSED                                    [ 83%]
    test_syscollector.py::test_get_os_agent PASSED                                                                  [ 84%]
    test_syscollector.py::test_get_hardware_agent PASSED                                                            [ 84%]
    test_syscollector.py::test_get_packages_agent PASSED                                                            [ 84%]
    test_syscollector.py::test_get_processes_agent PASSED                                                           [ 85%]
    test_syscollector.py::test_get_ports_agent PASSED                                                               [ 85%]
    test_syscollector.py::test_get_netaddr_agent PASSED                                                             [ 85%]
    test_syscollector.py::test_get_netproto_agent PASSED                                                            [ 85%]
    test_syscollector.py::test_get_netiface_agent PASSED                                                            [ 86%]
    test_syscollector.py::test_get_packages PASSED                                                                  [ 86%]
    test_syscollector.py::test_get_os PASSED                                                                        [ 86%]
    test_syscollector.py::test_get_hardware PASSED                                                                  [ 87%]
    test_syscollector.py::test_get_processes PASSED                                                                 [ 87%]
    test_syscollector.py::test_get_ports PASSED                                                                     [ 87%]
    test_syscollector.py::test_get_netaddr PASSED                                                                   [ 88%]
    test_syscollector.py::test_get_netproto PASSED                                                                  [ 88%]
    test_syscollector.py::test_get_netiface PASSED                                                                  [ 88%]
    test_util.py::test_version_ok[Wazuh v3.5.0-Wazuh v3.5.2] PASSED                                                 [ 89%]
    test_util.py::test_version_ok[Wazuh v3.6.1-Wazuh v3.6.3] PASSED                                                 [ 89%]
    test_util.py::test_version_ok[Wazuh v3.7.2-Wazuh v3.8.0] PASSED                                                 [ 89%]
    test_util.py::test_version_ok[Wazuh v3.8.0-Wazuh v3.8.1] PASSED                                                 [ 90%]
    test_util.py::test_version_ok[Wazuh v3.9.0-Wazuh v3.9.2] PASSED                                                 [ 90%]
    test_util.py::test_version_ok[Wazuh v3.9.10-Wazuh v3.9.14] PASSED                                               [ 90%]
    test_util.py::test_version_ok[Wazuh v3.10.1-Wazuh v3.10.10] PASSED                                              [ 91%]
    test_util.py::test_version_ok[Wazuh v4.10.10-Wazuh v4.11.0] PASSED                                              [ 91%]
    test_util.py::test_version_ok[Wazuh v5.1.15-Wazuh v5.2.0] PASSED                                                [ 91%]
    test_util.py::test_version_ok[v3.6.0-v3.6.1] PASSED                                                             [ 92%]
    test_util.py::test_version_ok[v3.9.1-v3.9.2] PASSED                                                             [ 92%]
    test_util.py::test_version_ok[v4.0.0-v4.0.1] PASSED                                                             [ 92%]
    test_util.py::test_version_ok[3.6.0-3.6.1] PASSED                                                               [ 92%]
    test_util.py::test_version_ok[3.9.0-3.9.2] PASSED                                                               [ 93%]
    test_util.py::test_version_ok[4.0.0-4.0.1] PASSED                                                               [ 93%]
    test_util.py::test_version_ko[v3.6.0-v.3.6.1] PASSED                                                            [ 93%]
    test_util.py::test_version_ko[Wazuh v4-Wazuh v5] PASSED                                                         [ 94%]
    test_util.py::test_version_ko[Wazuh v3.9-Wazuh v3.10] PASSED                                                    [ 94%]
    test_util.py::test_version_ko[ABC v3.10.1-ABC v3.10.12] PASSED                                                  [ 94%]
    test_util.py::test_version_ko[Wazuhv3.9.0-Wazuhv3.9.2] PASSED                                                   [ 95%]
    test_util.py::test_version_ko[3.9-3.10] PASSED                                                                  [ 95%]
    test_util.py::test_version_ko[3.9.0-3.10] PASSED                                                                [ 95%]
    test_util.py::test_version_ko[3.10-4.2] PASSED                                                                  [ 96%]
    test_util.py::test_version_ko[3-3.9.1] PASSED                                                                   [ 96%]
    test_util.py::test_same_version[Wazuh v3.10.10-Wazuh v3.10.10] PASSED                                           [ 96%]
    test_util.py::test_same_version[Wazuh v5.1.15-Wazuh v5.1.15] PASSED                                             [ 97%]
    test_util.py::test_same_version[v3.6.0-v3.6.0] PASSED                                                           [ 97%]
    test_util.py::test_same_version[v3.9.2-v3.9.2] PASSED                                                           [ 97%]
    test_wdb.py::test_failed_connection PASSED                                                                      [ 98%]
    test_wdb.py::test_wrong_character_encodings_wdb PASSED                                                          [ 98%]
    test_wdb.py::test_null_values_are_removed PASSED                                                                [ 98%]
    test_wdb.py::test_remove_agents_database[ok {"agents": {"001": "Ok"}}] PASSED                                   [ 99%]
    test_wdb.py::test_remove_agents_database[ok {"agents": {"0ad": "Invalid agent ID"}}] PASSED                     [ 99%]
    test_wdb.py::test_remove_agents_database[ok {"agents": {"001": "DB waiting for deletion"}}] PASSED              [ 99%]
    test_wdb.py::test_remove_agents_database[ok {"agents": {"001": "DB not found"}}] PASSED                         [100%]
    
    ============================================= 314 passed in 1.05 seconds ==============================================
    
    

    Pending

    • Finish decoder unit test
    评论

报告相同问题?