forked from wazuh/wazuh-docker
Test CI
This commit is contained in:
@@ -36,7 +36,23 @@ jobs:
|
|||||||
- name: Check Wazuh indexer start
|
- name: Check Wazuh indexer start
|
||||||
run: |
|
run: |
|
||||||
sleep 60
|
sleep 60
|
||||||
curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:SecretPassword -k -s | grep green
|
status="`curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:SecretPassword -k -s | wc -l`"
|
||||||
|
status-green="`curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:SecretPassword -k -s | grep green | wc -l`"
|
||||||
|
if [[ $status-green -eq $status ]]; then
|
||||||
|
curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:SecretPassword -k -s
|
||||||
|
else
|
||||||
|
curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:SecretPassword -k -s
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
status-index="`curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:SecretPassword -k -s | wc -l`"
|
||||||
|
status-index-green="`curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:SecretPassword -k -s | grep -E "green" | wc -l`"
|
||||||
|
if [[ $status-index-green -eq $status-index ]]; then
|
||||||
|
curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:SecretPassword -k -s
|
||||||
|
else
|
||||||
|
curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:SecretPassword -k -s
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
- name: Check Wazuh indexer nodes
|
- name: Check Wazuh indexer nodes
|
||||||
run: |
|
run: |
|
||||||
@@ -51,7 +67,7 @@ jobs:
|
|||||||
- name: Check documents into wazuh-alerts index
|
- name: Check documents into wazuh-alerts index
|
||||||
run: |
|
run: |
|
||||||
docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_doc/_search" -u admin:SecretPassword -k -s | jq -r ".hits.total.value"`"
|
docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_doc/_search" -u admin:SecretPassword -k -s | jq -r ".hits.total.value"`"
|
||||||
if [[ $docs -gt 0 ]]; then
|
if [[ $docs -gt 100 ]]; then
|
||||||
echo "wazuh-alerts index documents: ${docs}"
|
echo "wazuh-alerts index documents: ${docs}"
|
||||||
else
|
else
|
||||||
echo "wazuh-alerts index documents: ${docs}"
|
echo "wazuh-alerts index documents: ${docs}"
|
||||||
@@ -60,9 +76,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Check Wazuh templates
|
- name: Check Wazuh templates
|
||||||
run: |
|
run: |
|
||||||
qty_templates="`curl -XGET "https://0.0.0.0:9200/_cat/templates" -u admin:SecretPassword -k -s | grep "wazuh" | wc -l`"
|
qty_templates="`curl -XGET "https://0.0.0.0:9200/_cat/templates" -u admin:SecretPassword -k -s | grep -E "wazuh ||wazuh-agent||wazuh-statistics" | wc -l`"
|
||||||
templates="`curl -XGET "https://0.0.0.0:9200/_cat/templates" -u admin:SecretPassword -k -s | grep "wazuh"`"
|
templates="`curl -XGET "https://0.0.0.0:9200/_cat/templates" -u admin:SecretPassword -k -s | grep -E "wazuh ||wazuh-agent||wazuh-statistics"`"
|
||||||
if [[ $qty_templates -gt 0 ]]; then
|
if [[ $qty_templates -eq 3 ]]; then
|
||||||
echo "wazuh templates:"
|
echo "wazuh templates:"
|
||||||
echo "${templates}"
|
echo "${templates}"
|
||||||
else
|
else
|
||||||
@@ -107,7 +123,22 @@ jobs:
|
|||||||
- name: Check Wazuh indexer start
|
- name: Check Wazuh indexer start
|
||||||
run: |
|
run: |
|
||||||
sleep 120
|
sleep 120
|
||||||
curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:SecretPassword -k
|
status="`curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:SecretPassword -k -s | wc -l`"
|
||||||
|
status-green="`curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:SecretPassword -k -s | grep green | wc -l`"
|
||||||
|
if [[ $status-green -eq $status ]]; then
|
||||||
|
curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:SecretPassword -k -s
|
||||||
|
else
|
||||||
|
curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:SecretPassword -k -s
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
status-index="`curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:SecretPassword -k -s | wc -l`"
|
||||||
|
status-index-green="`curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:SecretPassword -k -s | grep -E "green" | wc -l`"
|
||||||
|
if [[ $status-index-green -eq $status-index ]]; then
|
||||||
|
curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:SecretPassword -k -s
|
||||||
|
else
|
||||||
|
curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:SecretPassword -k -s
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Check Wazuh indexer nodes
|
- name: Check Wazuh indexer nodes
|
||||||
run: |
|
run: |
|
||||||
@@ -122,7 +153,7 @@ jobs:
|
|||||||
- name: Check documents into wazuh-alerts index
|
- name: Check documents into wazuh-alerts index
|
||||||
run: |
|
run: |
|
||||||
docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_doc/_search" -u admin:SecretPassword -k -s | jq -r ".hits.total.value"`"
|
docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_doc/_search" -u admin:SecretPassword -k -s | jq -r ".hits.total.value"`"
|
||||||
if [[ $docs -gt 0 ]]; then
|
if [[ $docs -gt 200 ]]; then
|
||||||
echo "wazuh-alerts index documents: ${docs}"
|
echo "wazuh-alerts index documents: ${docs}"
|
||||||
else
|
else
|
||||||
echo "wazuh-alerts index documents: ${docs}"
|
echo "wazuh-alerts index documents: ${docs}"
|
||||||
|
|||||||
Reference in New Issue
Block a user