From 7bc0353ab2ed7601ac5ee59130eccd50aa822327 Mon Sep 17 00:00:00 2001 From: Christoph Galuschka Date: May 03 2012 19:04:58 +0000 Subject: added test for arpwatch --- diff --git a/tests/p_arpwatch/0_install_arpwatch.sh b/tests/p_arpwatch/0_install_arpwatch.sh new file mode 100755 index 0000000..aa0daba --- /dev/null +++ b/tests/p_arpwatch/0_install_arpwatch.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Author: Christoph Galuschka + +# Install arpwatch +t_InstallPackage arpwatch + diff --git a/tests/p_arpwatch/arpwatch_test.sh b/tests/p_arpwatch/arpwatch_test.sh new file mode 100755 index 0000000..4676c00 --- /dev/null +++ b/tests/p_arpwatch/arpwatch_test.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Athmane Madjoudj + +t_Log "Running $0 - arpwatch on eth0" + +# getting IP-address of default gateway +defgw=$(ip route list | grep default | cut -d' ' -f3) + +# setting path to arp.dat +if (t_GetPkgRel basesystem | grep -q el5) + then + arpdat='/var/arpwatch/arp.dat' +else + arpdat='/var/lib/arpwatch/arp.dat' +fi + +# beginning and running test +arp -d $defgw +arpwatch +sleep 2 +ping -q -i 0.25 -c 5 $defgw +killall arpwatch + +grep -q $defgw $arpdat +ret_val=$? + +# cleaning up +cat /dev/null > $arpdat + +t_CheckExitStatus $ret_val