Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new tests for Wazuh-DB insert commands in agents' CVEs table #1092

Merged
merged 1 commit into from
Feb 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions tests/integration/test_wazuh_db/data/agent_messages.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
-
name: "Agents' CVEs table: vuln_cves "
name: "Agents' CVEs table: vuln_cves"
description: "Checks the commands insert and clear"
test_case:
-
Expand All @@ -15,6 +15,10 @@
input: 'agent 000 vuln_cve insert {"name":"test_package","version":"1.0","architecture":"x86","cve":"CVE-2021-1001"}'
output: "err Cannot execute vuln_cve insert command; SQL err: UNIQUE constraint failed: vuln_cves.name, vuln_cves.version, vuln_cves.architecture, vuln_cves.cve"
stage: "agent vuln_cve insert duplicated entry"
-
input: 'agent 001 vuln_cve insert {"name":"test package","version":"1.0","architecture":"x86","cve":"1001"}'
output: "ok"
stage: "agent vuln_cve insert with spaces in json payload"
-
input: 'agent 000 vuln_cve clear'
output: "ok"
Expand All @@ -30,11 +34,15 @@
-
input: 'agent 000 vuln_cve insert {"name":"test_package",'
output: "err Invalid JSON syntax, near '{\"name\":\"test_package\",'"
stage: "agent vuln_cve insert invalid JSON "
stage: "agent vuln_cve insert invalid JSON"
-
input: 'agent 000 vuln_cve'
output: "err Invalid vuln_cve query syntax, near 'vuln_cve'"
stage: "agent vuln_cve missing command "
stage: "agent vuln_cve missing command"
-
input: 'agent 000 vuln_cve insert'
output: "err Invalid JSON syntax, near ''"
stage: "agent vuln_cve missing payload"
-
input: 'agent 000 vuln_cve insert {"name":"test_package2","version":"1.0","architecture":"x86","cve":"CVE-2021-1001"}'
output: "ok"
Expand Down