1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#!/bin/sh
set -e
ulimit -H -l unlimited 2>/dev/null || {
# https://bugs.launchpad.net/bugs/1828228
echo "test disabled for unprivileged namespaces"
exit 77
}
OUTPUT=$AUTOPKGTEST_TMP/walk.out
cleanup () {
service pacemaker stop
service corosync stop
rm -f $OUTPUT
}
trap "cleanup" 0 2 3 15
service corosync start
service pacemaker start
# enable localhost access to full snmp data
sed -i 's/^#\(rocommunity \+public \+localhost.*\)/\1/' /etc/snmp/snmpd.conf
service snmpd restart
service pcs_snmp_agent restart
sleep 60
pcs property set stonith-enabled=false 2>&1
pcs property set no-quorum-policy=ignore
pcs resource create dummy1 ocf:heartbeat:Dummy
pcs resource create dummy2 ocf:heartbeat:Dummy
sleep 60
snmpwalk -m PACEMAKER-PCS-V1-MIB -v 2c -c public localhost 1.3.6.1.4.1.32723.100.1 | tee $OUTPUT
grep -q 'RunningResourcesNum.0 = INTEGER: 2$' $OUTPUT
|