36 lines
804 B
Plaintext
36 lines
804 B
Plaintext
# Test that the top command can show all nodes in a cluster, or just a
|
|
# specified node. Also test that the exit status is zero if all nodes
|
|
# are running, and nonzero otherwise.
|
|
#
|
|
# @TEST-EXEC: bash %INPUT
|
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-top-output btest-diff all.out
|
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-top-output btest-diff onenode.out
|
|
# @TEST-EXEC: btest-diff stopped.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
|
|
|
|
zeekctl install
|
|
zeekctl start
|
|
|
|
# show all nodes
|
|
zeekctl top > all.out
|
|
|
|
# show one node
|
|
zeekctl top worker-1 > onenode.out
|
|
|
|
zeekctl stop worker-1
|
|
|
|
# not all nodes are running
|
|
! zeekctl top
|
|
|
|
zeekctl stop
|
|
|
|
# all nodes are stopped
|
|
! zeekctl top > stopped.out
|