#!/bin/sh

################################################################################
##                                                                            ##
## Copyright (c) International Business Machines  Corp., 2005                 ##
##                                                                            ##
## This program is free software;  you can redistribute it and#or modify      ##
## it under the terms of the GNU General Public License as published by       ##
## the Free Software Foundation; either version 2 of the License, or          ##
## (at your option) any later version.                                        ##
##                                                                            ##
## This program is distributed in the hope that it will be useful, but        ##
## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
## for more details.                                                          ##
##                                                                            ##
## You should have received a copy of the GNU General Public License          ##
## along with this program;  if not, write to the Free Software               ##
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
##                                                                            ##
##                                                                            ##
################################################################################
#
# File:
#   tcp4-uni-pktlossdup01
#
# Description:
#   Verify that the kernel is not crashed with a unreliable connection to with
#   the following condition:
#     - The version of IP is IPv4
#     - Network is not delayed
#     - IPsec is not used
#     - Disable window scaling
#     - Enable Nagle algorithm
#     - Enable TCP Duplicate SACK support
#     - Enable SACK Support
#     - Some packets are lost
#     - Disable TSO if it is avalable
#
#   *) This script may be read by the other test case
#
# Setup:
#   See ltp-yyyymmdd/testcases/network/stress/README
#
# Author:
#   Mitsuru Chinen <mitch@jp.ibm.com>
#
# History:
#	Oct 19 2005 - Created (Mitsuru Chinen)
#
#-----------------------------------------------------------------------
# Uncomment line below for debug output.
#trace_logic=${trace_logic:-"set -x"}
$trace_logic

# The test case ID, the test case count and the total number of test case
TCID=${TCID:-tcp4-uni-pktlossdup01}
TST_TOTAL=1
TST_COUNT=1
export TCID
export TST_COUNT
export TST_TOTAL

# Test description
tst_resm TINFO "Verify that the kernel is not crashed by a TCP connection on an unreliable network (Namely, some of the packets are lost, some of them is duplicated.)"

# Make some packets are lost
DO_PACKET_LOSS=true

# Make some packets are duplicated
DO_PACKET_DUP=true

# Load tcp4-uni-basic01
NON_BASIC=true

. tcp4-uni-basic01

exit 0