f3c5d9a59c
git-svn-id: file:///srv/dev-disk-by-uuid-17e88007-4d0c-45e0-8757-cacfcc458630/repositories/svn/Diplomarbeit@108 9fe90eed-be63-e94b-8204-d34ff4c2ff93
50 lines
1.3 KiB
Bash
50 lines
1.3 KiB
Bash
#!/bin/sh
|
|
|
|
# Hint: "ori" = ORIginal; "rb" = ReadBack; "res" = RESult; "err" = ERRor
|
|
|
|
|
|
# Make shure that result Directory exists
|
|
if [ ! -d /test/result ]
|
|
then
|
|
mkdir /test/result
|
|
fi
|
|
|
|
# Make shure that result file of Test does NOT exists
|
|
if [ -s /test/result/eth1.res ]
|
|
then
|
|
rm /test/result/eth1.res
|
|
fi
|
|
|
|
# Make shure that error file of Test does NOT exists
|
|
if [ -s /test/result/eth1.err ]
|
|
then
|
|
rm /test/result/eth1.err
|
|
fi
|
|
|
|
# Ping Server in local network to make shure Ethernet Device works
|
|
# "-c 4": Send only 4 packages
|
|
# "-I eth1": Use Ethernet 1 as device
|
|
ping -c 4 -I eth1 192.168.1.2 1> /test/result/eth1.res 2> /test/result/eth1.err
|
|
|
|
|
|
# Display content of /test/result/eth2.res
|
|
echo -e "\n\rContent of eth1.res"
|
|
cat /test/result/eth1.res
|
|
|
|
# Display content of /test/result/eth2.err
|
|
echo -e "\n\rContent of eth1.err"
|
|
cat /test/result/eth1.err
|
|
|
|
# Variable "$?" contains the ping result. 0 represents a successful ping. If ethernet device not available, error file will
|
|
# not be empty
|
|
if [ $? -eq 0 -a ! -s /test/result/eth1.err ]
|
|
then
|
|
# Test was successful
|
|
echo -e "\n\rETHERNET 1 TEST-PASSED"
|
|
echo "ETHERNET 1 TEST-PASSED" >> /test/result/eth1.res
|
|
else
|
|
# Test failed
|
|
echo -e "\n\rETHERNET 1 TEST-FAIL"
|
|
echo "\n\rETHERNET 1 TEST-FAILED" >> /test/result/eth1.res
|
|
fi
|