Below LTP test cases are failing in Debian based systems.
1) ltp-full-20130109/testcases/network/multicast/mc_cmds/ mc_cmds
2) ltp-full-20130109/testcases/network/multicast/mc_commo/mc_commo
Please find analysis and code changes as below; I have also attached the code
chages with this e-mail:
1) ltp-full-20130109/testcases/network/multicast/mc_cmds/ mc_cmds
net/ipv4/icmp.c ( In upstream kernel)
/* Control parameters for ECHO replies. */
net->ipv4.sysctl_icmp_echo_ignore_all = 0;
net->ipv4.sysctl_icmp_echo_ignore_broadcasts = 1;
In “mc_cmds” test case we have code as below:
cat /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts | grep 1 > /dev/null
if [ $? -eq 0 ]
then
end_testcase "Multicast ping disabled on this system (this is normal on
post year:2005 kernels)"
fi
Hence the test tcase will fail always as icmp_echo_ignore_broadcasts is set to
1(which is default).
Can we go with below patch for this problem?
--- mc_cmds.Orig 2013-04-03 14:36:14.000000000 -0600
+++ mc_cmds 2013-04-03 14:39:02.000000000 -0600
@@ -128,6 +128,9 @@
if [ $? -eq 0 ]
then
end_testcase "Multicast ping disabled on this system (this is normal on
post year:2005 kernels)"
+ echo "Temporarily enable multicast ping for testing purposes."
+ echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
+ icmp_need_reset=1
fi
# Do the ping tests: Execute ping 224.0.0.1 - Verify that the proper
@@ -166,6 +169,10 @@
{
$trace_logic
echo "$this_file: doing $0."
+ if [ -n "$icmp_need_reset" ]; then
+ echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
+ echo "Restored multicast ping setting."
+ fi
rm -rf $PING_OUT
}
2) ltp-full-20130109/testcases/network/multicast/mc_commo/mc_commo
In Debian, "/etc/hosts" looks like the following.
127.0.0.1 localhost
127.0.1.1 <host_name>.<domain_name> <host_name>
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
The second line in this file is as a workaround for some softwares. (Ref:
http://bugs.debian.org/316099 )
Since the host IP value will be taken as 127.0.1.1 during test case execution
test fails.
Can we go with the below code changes?
Signed-off-by: Chandrashekhar Nandi <[email protected]>
--- mc_commo.Orig 2013-04-03 15:28:56.000000000 -0600
+++ mc_commo 2013-04-03 15:35:00.000000000 -0600
@@ -50,6 +50,11 @@
OUTFILE=$TCtmp/mc_commo_out
NUMLOOPS=${NUMLOOPS:-2}
INTERFACE=${INTERFACE:-$("$LTPROOT/bin/gethost" `hostname` | grep addresses: |
awk '{print $2}')}
+IPV4_NETWORK=${IPV4_NETWORK:-"192.168.100"}
+IPV4_LHOST=${LHOST_IPV4_HOST:-"1"}
+IPV4_RHOST=${LHOST_IPV4_HOST:-"2"}
+LINK_NUM=${LINK_NUM-"0"}
+declare -A RHOST_LIST
this_file=${0##*/}
trap "interrupt_test" 2
@@ -58,6 +63,25 @@
mkdir -p $TCtmp
OCTET=`ps -ewf | grep [m]c_commo | wc -l | awk '{print $1}'`
GROUP_ADDR=224.0.0.$OCTET
+
+ if [ $RHOST != `hostname` ]; then
+ initialize_if lhost $LINK_NUM
+ [ $? = 0 ] || end_testcase "Could NOT initialize local host link"
+
+ initialize_if rhost $LINK_NUM
+ [ $? = 0 ] || end_testcase "Could NOT initialize remote host link"
+
+ set_ipv4addr lhost $LINK_NUM ${IPV4_NETWORK} ${IPV4_LHOST}
+ [ $? = 0 ] || end_testcase "Failed to set ipv4 address to local host"
+
+ set_ipv4addr rhost $LINK_NUM ${IPV4_NETWORK} ${IPV4_RHOST}
+ [ $? = 0 ] || end_testcase "Failed to set ipv4 address to remote host"
+
+ INTERFACE=${IPV4_NETWORK}.${IPV4_LHOST}
+ RHOST_LIST[$RHOST]=${IPV4_NETWORK}.${IPV4_RHOST}
+ else
+ RHOST_LIST[$RHOST]=`hostname`
+ fi
}
#*******************************************************************************
@@ -129,7 +153,7 @@
echo "Running on $HOST mc_send $GROUP_ADDR $HOST $PORT $TTL"
rsh -n -l root $HOST "$LTPROOT/testcases/bin/$REMOTE_EXEC"
$GROUP_ADDR \
- $HOST $PORT $TTL >/dev/null &
+ ${RHOST_LIST[$HOST]} $PORT $TTL >/dev/null &
sleep 10
rsh -n -l root $HOST "ps -ewf | grep mc_send | grep -v grep"
[ $? = 0 ] || end_testcase "Could NOT start mc_send on $HOST"
@@ -143,7 +167,7 @@
#test if datagrams has been sent
for HOST in $RHOST
do
- grep -q "$HOST [0-9] [0-9]" $OUTFILE
+ grep -q "${RHOST_LIST[$HOST]} [0-9] [0-9]" $OUTFILE
[ $? = 0 ] || end_testcase "NO Datagrams received from $HOST"
done
}
@@ -175,6 +199,9 @@
rm -rf $TCtmp/pingfile
rm -rf $TCtmp/mc_commo_out
rm -rf $TCtmp
+
+ initialize_if lhost $LINK_NUM
+ initialize_if rhost $LINK_NUM
}
#=============================================================================
Thanks,
Chandrashekhar Nandi------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list