File: snmp

package info (click to toggle)
pcs 0.12.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,148 kB
  • sloc: python: 238,810; xml: 20,833; ruby: 13,203; makefile: 1,595; sh: 484
file content (40 lines) | stat: -rwxr-xr-x 888 bytes parent folder | download
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