mirror of
https://github.com/vxcontrol/soldr-modules.git
synced 2026-07-21 08:55:22 -04:00
[GH-ISSUE #42] [Bug]: __mock.module_info hasn't enough data #17
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @0legovich on GitHub (Jan 10, 2023).
Original GitHub issue: https://github.com/vxcontrol/soldr-modules/issues/42
Originally assigned to: @asdek on GitHub.
Describe the bug
I tried to write a simple test for my module and get unexpected error
After a little research, I realized that __mock.module_config hasn't enough data. I found the row with initializing and containing __mock.module_info https://github.com/vxcontrol/soldr-modules/blob/master/utils/mock/core.lua#L693 and was unhappy surprised there are no fields:
fields,actions,events. As I understand __mock.module_info should contains data from file<module_name>/<version>/config/info.json.I crookedly fixed it in my module, but it will be better if __mock.module_info contains real data from
<module_name>/<version>/config/info.json.Steps to Reproduce
prepare environment by Wiki: https://github.com/vxcontrol/soldr-modules/wiki/Unit-testing
cd soldr-modulesgit fetch origin osquery_linux (if not merged)Import test code:
./tests_framework/lua/bin/busted.osx64.cmd tests/osquery_linux_client_spec.luaExpected behavior:
Actual behavior:
Screenshots, screen recording, code snippet
No response
Environment information
Which agent binary used?