7 \cp -f materials/B-56-l7vs.cf ${L7VSD_CONF_DIR}/l7vs.cf
10 ${SNMPTRAPD} -c ./materials/B-56-snmptrapd.conf -Lf ${L7VS_LOG_DIR}/B-56-snmptrapd.log
12 #check service snmpd is running
16 echo "Test failed: snmp is not running"
25 echo "Test failed: $L7VSD"
32 $L7VSADM -S -t 1 -l warn
35 echo "Test failed: $L7VSADM -S -t 1 -l warn"
40 $L7VSADM -A -t 127.0.0.1:40001 -m sessionless
43 echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless"
46 #Add virtual Service Again
47 $L7VSADM -A -t 127.0.0.1:40001 -m sessionless
49 #need time to write log file
54 RET=`cat ${L7VS_LOG_DIR}/B-56-snmptrapd.log | grep -e "SNMPv2-SMI::enterprises.32132.1.0.3.3 = STRING: \"[0-9]\{4\}/[0-9]\{2\}/[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\},VSD3.*"`
57 echo "Test failed: cat ${L7VS_LOG_DIR}/B-56-snmptrapd.log"
62 RET=`snmpwalk -v 2c -c public localhost ULTRAMONKEY-L7-MIB::ultramonkey-l7`
63 EXPECT="ULTRAMONKEY-L7-MIB::l7vsVsNumber.0 = INTEGER: 1
64 ULTRAMONKEY-L7-MIB::l7vsVsIndex.1 = INTEGER: 1
65 ULTRAMONKEY-L7-MIB::l7vsVsProtocol.1 = INTEGER: tcp(1)
66 ULTRAMONKEY-L7-MIB::l7vsVsAddrType.1 = INTEGER: IPv4(1)
67 ULTRAMONKEY-L7-MIB::l7vsVsAddr.1 = STRING: \"127.0.0.1\"
68 ULTRAMONKEY-L7-MIB::l7vsVsPort.1 = Gauge32: 40001
69 ULTRAMONKEY-L7-MIB::l7vsVsProtocolModuleName.1 = STRING: sessionless
70 ULTRAMONKEY-L7-MIB::l7vsVsProtocolModuleOptions.1 = STRING:
71 ULTRAMONKEY-L7-MIB::l7vsVsScheduleModuleName.1 = STRING: rr
72 ULTRAMONKEY-L7-MIB::l7vsVsScheduleModuleOptions.1 = STRING:
73 ULTRAMONKEY-L7-MIB::l7vsVsSorryAddrType.1 = INTEGER: IPv4(1)
74 ULTRAMONKEY-L7-MIB::l7vsVsSorryAddr.1 = STRING: \"0.0.0.0\"
75 ULTRAMONKEY-L7-MIB::l7vsVsSorryPort.1 = Gauge32: 0
76 ULTRAMONKEY-L7-MIB::l7vsVsSorryConnLimit.1 = Counter64: 0 Connections
77 ULTRAMONKEY-L7-MIB::l7vsVsSorryForceEnabled.1 = INTEGER: off(2)
78 ULTRAMONKEY-L7-MIB::l7vsVsThroughputUp.1 = Counter64: 0 B/s
79 ULTRAMONKEY-L7-MIB::l7vsVsThroughputDown.1 = Counter64: 0 B/s
80 ULTRAMONKEY-L7-MIB::l7vsVsThroughputUpQoS.1 = Counter64: 0 B/s
81 ULTRAMONKEY-L7-MIB::l7vsVsThroughputDownQos.1 = Counter64: 0 B/s
82 ULTRAMONKEY-L7-MIB::l7vsVsSslFlag.1 = INTEGER: 0
83 ULTRAMONKEY-L7-MIB::l7vsVsSessionPoolCount.1 = INTEGER: 31
84 ULTRAMONKEY-L7-MIB::l7vsVsSessionActiveCount.1 = INTEGER: 0
85 ULTRAMONKEY-L7-MIB::l7vsVsSessionWaitCount.1 = INTEGER: 1
86 ULTRAMONKEY-L7-MIB::l7vsVsHttpTotalCount.1 = Counter64: 0
87 ULTRAMONKEY-L7-MIB::l7vsVsHttpGetCount.1 = Counter64: 0
88 ULTRAMONKEY-L7-MIB::l7vsVsHttpPostCount.1 = Counter64: 0
89 ULTRAMONKEY-L7-MIB::l7vsVsRsNumber.1 = INTEGER: 0
90 ULTRAMONKEY-L7-MIB::l7vsReplicationMode.0 = INTEGER: single(1)"
92 if [ "${RET}" != "${EXPECT}" ]
94 echo "Test failed: snmpwalk -v 2c -c public localhost ULTRAMONKEY-L7-MIB::ultramonkey-l7"
104 #Add virtual Service Again
106 $L7VSADM -A -t 127.0.0.1:40001 -m sessionless
109 RET=`cat ${L7VS_LOG_DIR}/B-56-snmptrapd.log | grep -e "SNMPv2-SMI::enterprises.32132.1.0.3.3 = STRING: \"[0-9]\{4\}/[0-9]\{2\}/[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\},VSD3.*" | wc -l`
111 if [ "${RET}" != "2" ]
113 echo "Test failed: cat ${L7VS_LOG_DIR}/B-56-snmptrapd.log"
120 RET=`snmpwalk -v 2c -c public localhost ULTRAMONKEY-L7-MIB::ultramonkey-l7`
121 EXPECT="ULTRAMONKEY-L7-MIB::l7vsVsNumber.0 = INTEGER: 1
122 ULTRAMONKEY-L7-MIB::l7vsVsIndex.1 = INTEGER: 1
123 ULTRAMONKEY-L7-MIB::l7vsVsProtocol.1 = INTEGER: tcp(1)
124 ULTRAMONKEY-L7-MIB::l7vsVsAddrType.1 = INTEGER: IPv4(1)
125 ULTRAMONKEY-L7-MIB::l7vsVsAddr.1 = STRING: \"127.0.0.1\"
126 ULTRAMONKEY-L7-MIB::l7vsVsPort.1 = Gauge32: 40001
127 ULTRAMONKEY-L7-MIB::l7vsVsProtocolModuleName.1 = STRING: sessionless
128 ULTRAMONKEY-L7-MIB::l7vsVsProtocolModuleOptions.1 = STRING:
129 ULTRAMONKEY-L7-MIB::l7vsVsScheduleModuleName.1 = STRING: rr
130 ULTRAMONKEY-L7-MIB::l7vsVsScheduleModuleOptions.1 = STRING:
131 ULTRAMONKEY-L7-MIB::l7vsVsSorryAddrType.1 = INTEGER: IPv4(1)
132 ULTRAMONKEY-L7-MIB::l7vsVsSorryAddr.1 = STRING: \"0.0.0.0\"
133 ULTRAMONKEY-L7-MIB::l7vsVsSorryPort.1 = Gauge32: 0
134 ULTRAMONKEY-L7-MIB::l7vsVsSorryConnLimit.1 = Counter64: 0 Connections
135 ULTRAMONKEY-L7-MIB::l7vsVsSorryForceEnabled.1 = INTEGER: off(2)
136 ULTRAMONKEY-L7-MIB::l7vsVsThroughputUp.1 = Counter64: 0 B/s
137 ULTRAMONKEY-L7-MIB::l7vsVsThroughputDown.1 = Counter64: 0 B/s
138 ULTRAMONKEY-L7-MIB::l7vsVsThroughputUpQoS.1 = Counter64: 0 B/s
139 ULTRAMONKEY-L7-MIB::l7vsVsThroughputDownQos.1 = Counter64: 0 B/s
140 ULTRAMONKEY-L7-MIB::l7vsVsSslFlag.1 = INTEGER: 0
141 ULTRAMONKEY-L7-MIB::l7vsVsSessionPoolCount.1 = INTEGER: 31
142 ULTRAMONKEY-L7-MIB::l7vsVsSessionActiveCount.1 = INTEGER: 0
143 ULTRAMONKEY-L7-MIB::l7vsVsSessionWaitCount.1 = INTEGER: 1
144 ULTRAMONKEY-L7-MIB::l7vsVsHttpTotalCount.1 = Counter64: 0
145 ULTRAMONKEY-L7-MIB::l7vsVsHttpGetCount.1 = Counter64: 0
146 ULTRAMONKEY-L7-MIB::l7vsVsHttpPostCount.1 = Counter64: 0
147 ULTRAMONKEY-L7-MIB::l7vsVsRsNumber.1 = INTEGER: 0
148 ULTRAMONKEY-L7-MIB::l7vsReplicationMode.0 = INTEGER: single(1)"
150 echo "$EXPECT" > /tmp/1.txt
151 echo "$RET" > /tmp/2.txt
152 diff /tmp/1.txt /tmp/2.txt
154 if [ "${RET}" != "${EXPECT}" ]
156 echo "Test failed: snmpwalk -v 2c -c public localhost ULTRAMONKEY-L7-MIB::ultramonkey-l7"