zeek/auxil/zeekctl/testing/command/start-state-cluster.test
Patrick Kelley 8fd444092b initial
2025-05-07 15:35:15 -04:00

27 lines
666 B
Plaintext

# Test that the start command writes correct values to state database for
# a cluster configuration.
#
# @TEST-REQUIRES: which sqlite3
# @TEST-EXEC: bash %INPUT
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-state-db btest-diff out
. zeekctl-test-setup
while read line; do installfile $line; done << EOF
etc/zeekctl.cfg__no_email
etc/node.cfg__cluster
bin/zeek__test
EOF
test ! -e $ZEEKCTL_INSTALL_PREFIX/spool/state.db
zeekctl install
zeekctl start
sqlite3 $ZEEKCTL_INSTALL_PREFIX/spool/state.db ".dump" > dump.out
# Produce "key = value" output from the database dump.
awk -F \' '{ if (NF == 5) { print $2, "=", $4 } }' dump.out | sort > out
zeekctl stop