Skip to content

Commit

Permalink
Merge pull request #460 from tiiuae/mdm_agent_unittests
Browse files Browse the repository at this point in the history
Add MDM agent unittests
  • Loading branch information
joenpera authored May 23, 2024
2 parents 65900fd + 85ed8fb commit 190b749
Show file tree
Hide file tree
Showing 3 changed files with 829 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name Stmts Miss Cover Missing
-----------------------------------------------------------------
mdm_agent.py 456 313 31% 104-105, 144, 165-216, 246, 250-254, 265-273, 282-284, 290, 297-365, 378-379, 388-392, 402-497, 505-550, 560-595, 606-629, 650, 661-667, 683-719, 737-741, 747-761, 774-835, 846-897, 901-919
mdm_agent.py 458 110 76% 115-117, 190, 209-210, 215-216, 246, 250-254, 265-273, 282-284, 290, 310-319, 325-353, 364, 378-379, 388-392, 406, 408, 441-456, 464-474, 492-496, 591, 650, 661-667, 680-681, 702, 713-719, 740-741, 748-749, 756-757, 787-793, 796-817, 825-827, 833, 853-854, 864, 921
src/__init__.py 0 0 100%
src/bat_ctrl_utils.py 130 19 85% 40-41, 78-79, 135-136, 161-162, 173, 193-194, 224-225, 254-263, 277-279
src/cbma_adaptation.py 458 372 19% 81-82, 90-102, 112-181, 184-192, 195-219, 225-239, 242-249, 257-294, 297-302, 309-319, 322-325, 328-338, 341-348, 352-399, 403-419, 422-462, 470-483, 486-511, 518-532, 536-563, 578-606, 616-647, 657-668, 671-682, 693-721, 729-765, 774-845, 848-855, 864-874, 882-891
Expand All @@ -24,12 +24,12 @@ tests/test_config_store.py 26 0 100%
tests/test_constants.py 27 0 100%
tests/test_controller.py 32 0 100%
tests/test_if_monitor.py 25 1 96% 32
tests/test_mdm_agent.py 57 0 100%
tests/test_mdm_agent.py 476 0 100%
tests/test_service_discovery.py 45 6 87% 32-33, 55-56, 78-79
tests/test_settings.py 173 0 100%
tests/test_status.py 128 8 94% 28-35
tests/test_validation.py 146 0 100%
-----------------------------------------------------------------
TOTAL 3200 841 74%
TOTAL 3621 638 82%
Not tested files as not MDM content or tested elsewhere:
batadvvis.py,batstat.py,fmo_agent.py,comms_nats_discovery.py,cbma/*,debug_tests/*,comms_mesh_telemetry.py,comms_interface_info.py
6 changes: 4 additions & 2 deletions modules/sc-mesh-secure-deployment/src/nats/mdm_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,8 +896,7 @@ def signal_handler(signum, frame):
finally:
signal_handler(signal.SIGUSR1, signal_handler)


if __name__ == "__main__":
def main():
parser = argparse.ArgumentParser(description="Mesh Settings")
parser.add_argument("-k", "--keyfile", help="TLS keyfile", required=False)
parser.add_argument("-c", "--certfile", help="TLS certfile", required=False)
Expand All @@ -917,3 +916,6 @@ def signal_handler(signum, frame):
main_mdm(args.keyfile, args.certfile, args.ca, args.interface)
)
loop.close()

if __name__ == "__main__":
main()
Loading

0 comments on commit 190b749

Please sign in to comment.