This PR fixes #363 in df18a3f787dedf78a1a8269ea8f4fc941206c138.
Running our mocha tests I realized there was an additional bug. The test to do a request omitting path argument was working properly but caused the following errors in the api.log file:
That means, despite the API was returning an error, the python backend was still being called. I fixed this bug in 152472558b9207839ad689b7918bc526e87d301e.
Mocha tests:
# mocha test/test_manager.js --grep POST/manager/files
Manager
POST/manager/files
✓ Upload ossec.conf (323ms)
✓ Upload ossec.conf (overwrite=false) (303ms)
✓ Upload rules (new rule) (334ms)
✓ Upload rules (overwrite=true) (295ms)
✓ Upload rules (overwrite=false) (286ms)
✓ Upload decoder (overwrite=true) (289ms)
✓ Upload decoder (without overwrite parameter) (288ms)
✓ Upload list (overwrite=true) (285ms)
✓ Upload list (without overwrite parameter) (298ms)
✓ Upload malformed rule
✓ Upload malformed decoder
✓ Upload malformed list
✓ Upload list with empty path
✓ Upload a file with a wrong content type
14 passing (3s)
# mocha test/test_cluster.js --grep POST/cluster/:node_id/files
Cluster
POST/cluster/:node_id/files
✓ Upload ossec.conf (master) (298ms)
✓ Upload ossec.conf (worker) (343ms)
✓ Upload new rules (332ms)
✓ Upload rules (overwrite=true) (296ms)
✓ Upload rules (overwrite=false) (291ms)
✓ Upload new decoder (303ms)
✓ Upload decoder (overwrite=true) (308ms)
✓ Upload decoder (without overwrite parameter) (303ms)
✓ Upload new list (281ms)
✓ Upload list (overwrite=true) (275ms)
✓ Upload list (overwrite=false) (280ms)
✓ Upload corrupted ossec.conf (master)
✓ Upload corrupted ossec.conf (worker)
✓ Upload malformed rules
✓ Upload rules to unexisting node (276ms)
✓ Upload malformed decoder
✓ Upload decoder to unexisting node (279ms)
✓ Upload malformed list
✓ Upload list to unexisting node (272ms)
✓ Upload list with empty path
✓ Upload a file with a wrong content type
21 passing (5s)
Hello team,
This PR fixes #363 in df18a3f787dedf78a1a8269ea8f4fc941206c138.
Running our mocha tests I realized there was an additional bug. The test to do a request omitting
path
argument was working properly but caused the following errors in theapi.log
file:That means, despite the API was returning an error, the python backend was still being called. I fixed this bug in 152472558b9207839ad689b7918bc526e87d301e.
Mocha tests:
Best regards, Marta