Skip to content

Instantly share code, notes, and snippets.

@adrianlzt
Created May 22, 2014 11:43
Show Gist options
  • Select an option

  • Save adrianlzt/78ab542793d09197bd6a to your computer and use it in GitHub Desktop.

Select an option

Save adrianlzt/78ab542793d09197bd6a to your computer and use it in GitHub Desktop.
Testing IPaddr2 bug
#!/bin/bash
# https://github.com/ClusterLabs/resource-agents/pull/320
# Script to try to reproduce the bug
while true; do
PRE=$(</proc/net/dev)
STDOUT=$(/bin/bash /usr/lib/ocf/lib/heartbeat/findif.sh 2>&1)
if [[ $? != 0 ]]; then
echo "Before /proc/net/dev" > /tmp/bug-resource-agents
echo "$PRE" >> /tmp/bug-resource-agents
echo -e "\n\nError" >> /tmp/bug-resource-agents
echo "$STDOUT" >> /tmp/bug-resource-agents
echo -e "\n\nAfter /proc/net/dev" >> /tmp/bug-resource-agents
cat /proc/net/dev >> /tmp/bug-resource-agents
echo "Testing findif" | mail -s "Reproduced pacemaker error" -c "xxxx@xxx.com" -a /tmp/bug-resource-agents yyyy@yyyy.com
fi
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment