#!/bin/sh

set -e

# Corosync did not start if the test container is unprivileged:
printf 'system.allow_knet_handle_fallback: yes\n' >>/etc/corosync/corosync.conf
service corosync start

OUTPUT="${AUTOPKGTEST_ARTIFACTS:-.}/crm_mon.txt"

# Wait more than dc-deadtime (20s by default)
sleep 25

crm_mon -1 >"$OUTPUT"
cat "$OUTPUT"
fgrep -q "Online: [ node1 ]" "$OUTPUT"
