folder modifications

git-svn-id: file:///srv/dev-disk-by-uuid-17e88007-4d0c-45e0-8757-cacfcc458630/repositories/svn/Diplomarbeit@108 9fe90eed-be63-e94b-8204-d34ff4c2ff93
This commit is contained in:
Matthias
2009-01-12 08:27:33 +00:00
parent 4381f5512f
commit f3c5d9a59c
10 changed files with 654 additions and 3 deletions
+130
View File
@@ -0,0 +1,130 @@
#!/bin/sh
# Functionality:
# Slaves COM is sending a defined String to the same COM on Master.
# Master is running a background process that
# only returns what comes in.
# Hint: "ori" = ORIginal; "rb" = ReadBack; "res" = RESult; "err" = ERRor
#-----------------------------------------------------------------------------
# PREPERATIONS
#-----------------------------------------------------------------------------
# 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/bus1.res ]
then
rm /test/result/bus1.res
fi
# Make shure that error file of Test does NOT exists
if [ -s /test/result/bus1.err ]
then
rm /test/result/bus1.err
fi
# Make shure that Original file of Test does NOT exists
if [ -s /test/result/bus1.ori ]
then
rm /test/result/bus1.ori
fi
# Make shure that readback file of Test does NOT exists
if [ -s /test/result/bus1.rb ]
then
rm /test/result/bus1.rb
fi
# Set up COM3
stty -F /dev/ttyS4 -echo -echoe -echok -echonl -echoprt -echoctl -echoke -ocrnl -icrnl -onlcr -opost crtscts clocal cread cs8 ignpar
stty -F /dev/ttyS5 -echo -echoe -echok -echonl -echoprt -echoctl -echoke -ocrnl -icrnl -onlcr -opost crtscts clocal cread cs8 ignpar
#-----------------------------------------------------------------------------
# TEST WITH 19200 BAUD
#-----------------------------------------------------------------------------
# Message Baudrate to Log
echo -e "Test bus1 with Baudrate: 19200\n\r"
# Set Baudrate
stty -F /dev/ttyS4 19200
stty -F /dev/ttyS5 19200
# Start a Backgroundprocess to receive something
cat /dev/ttyS5 1>> /test/result/bus1.rb &
sleep 1
# Send the defined String
echo "This is BUS1 Test with 19200 Baud" > /dev/ttyS4
echo "This is BUS1 Test with 19200 Baud" 1>> /test/result/bus1.ori
# Set Script-Process to Sleep to have time to receive something
sleep 1
# After Receiving (Or Timeout), kill all Processes on CAT
killall cat
# Compare the read String with the original one
diff /test/result/bus1.ori /test/result/bus1.rb 1>> /test/result/bus1.res
2>> /test/result/bus1.err
#-----------------------------------------------------------------------------
# TEST WITH 115200 BAUD
#-----------------------------------------------------------------------------
# Message Baudrate to Log
echo -e "Test bus1 with Baudrate: 115200\n\r"
# Set Baudrate
stty -F /dev/ttyS4 115200
stty -F /dev/ttyS5 115200
# Start a Backgroundprocess to receive something
cat /dev/ttyS5 1>> /test/result/bus1.rb &
sleep 1
# Send the defined String
echo "This is BUS1 Test with 115200 Baud" > /dev/ttyS4
echo "This is BUS1 Test with 115200 Baud" 1>> /test/result/bus1.ori
# Set Script-Process to Sleep to have time to receive something
sleep 1
# After Receiving (Or Timeout), kill all Processes on CAT
killall cat
# Compare the read String with the original one
diff /test/result/bus1.ori /test/result/bus1.rb 1>> /test/result/bus1.res
2>> /test/result/bus1.err
#-----------------------------------------------------------------------------
# OUTPUT AND RESULT CALCULATION
#-----------------------------------------------------------------------------
# Display content of /test/result/bus1.res
echo -e "\n\rContent of bus1.res"
cat /test/result/bus1.res
# Display content of /test/result/bus1.err
echo -e "\n\rContent of bus1.err"
cat /test/result/bus1.err
# If comparison returned neither results nor errors, the copying and comparision was successful
if [ ! -s /test/result/bus1.res -a ! -s /test/result/bus1.err ]
then
# Test was successful
echo -e "\n\rBUS1 TEST-PASSED"
echo "BUS1 TEST-PASSED" >> /test/result/bus1.res
else
# Test failed
echo -e "\n\rBUS1 TEST-FAIL"
echo "BUS1 TEST-FAILED" >> /test/result/bus1.res
fi
+130
View File
@@ -0,0 +1,130 @@
#!/bin/sh
# Functionality:
# Slaves COM is sending a defined String to the same COM on Master.
# Master is running a background process that
# only returns what comes in.
# Hint: "ori" = ORIginal; "rb" = ReadBack; "res" = RESult; "err" = ERRor
#-----------------------------------------------------------------------------
# PREPERATIONS
#-----------------------------------------------------------------------------
# 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/bus2.res ]
then
rm /test/result/bus2.res
fi
# Make shure that error file of Test does NOT exists
if [ -s /test/result/bus2.err ]
then
rm /test/result/bus2.err
fi
# Make shure that Original file of Test does NOT exists
if [ -s /test/result/bus2.ori ]
then
rm /test/result/bus2.ori
fi
# Make shure that readback file of Test does NOT exists
if [ -s /test/result/bus2.rb ]
then
rm /test/result/bus2.rb
fi
# Set up COM3
stty -F /dev/ttyS4 -echo -echoe -echok -echonl -echoprt -echoctl -echoke -ocrnl -icrnl -onlcr -opost crtscts clocal cread cs8 ignpar
stty -F /dev/ttyS5 -echo -echoe -echok -echonl -echoprt -echoctl -echoke -ocrnl -icrnl -onlcr -opost crtscts clocal cread cs8 ignpar
#-----------------------------------------------------------------------------
# TEST WITH 19200 BAUD
#-----------------------------------------------------------------------------
# Message Baudrate to Log
echo -e "Test bus2 with Baudrate: 19200\n\r"
# Set Baudrate
stty -F /dev/ttyS4 19200
stty -F /dev/ttyS5 19200
# Start a Backgroundprocess to receive something
cat /dev/ttyS4 1>> /test/result/bus2.rb &
sleep 1
# Send the defined String
echo "This is BUS2 Test with 19200 Baud" > /dev/ttyS5
echo "This is BUS2 Test with 19200 Baud" 1>> /test/result/bus2.ori
# Set Script-Process to Sleep to have time to receive something
sleep 1
# After Receiving (Or Timeout), kill all Processes on CAT
killall cat
# Compare the read String with the original one
diff /test/result/bus2.ori /test/result/bus2.rb 1>> /test/result/bus2.res
2>> /test/result/bus2.err
#-----------------------------------------------------------------------------
# TEST WITH 115200 BAUD
#-----------------------------------------------------------------------------
# Message Baudrate to Log
echo -e "Test bus2 with Baudrate: 115200\n\r"
# Set Baudrate
stty -F /dev/ttyS4 115200
stty -F /dev/ttyS5 115200
# Start a Backgroundprocess to receive something
cat /dev/ttyS4 1>> /test/result/bus2.rb &
sleep 1
# Send the defined String
echo "This is BUS2 Test with 115200 Baud" > /dev/ttyS5
echo "This is BUS2 Test with 115200 Baud" 1>> /test/result/bus2.ori
# Set Script-Process to Sleep to have time to receive something
sleep 1
# After Receiving (Or Timeout), kill all Processes on CAT
killall cat
# Compare the read String with the original one
diff /test/result/bus2.ori /test/result/bus2.rb 1>> /test/result/bus2.res
2>> /test/result/bus2.err
#-----------------------------------------------------------------------------
# OUTPUT AND RESULT CALCULATION
#-----------------------------------------------------------------------------
# Display content of /test/result/bus2.res
echo -e "\n\rContent of bus2.res"
cat /test/result/bus2.res
# Display content of /test/result/bus2.err
echo -e "\n\rContent of bus2.err"
cat /test/result/bus2.err
# If comparison returned neither results nor errors, the copying and comparision was successful
if [ ! -s /test/result/bus2.res -a ! -s /test/result/bus2.err ]
then
# Test was successful
echo -e "\n\rBUS2 TEST-PASSED"
echo "BUS2 TEST-PASSED" >> /test/result/bus2.res
else
# Test failed
echo -e "\n\rBUS2 TEST-FAIL"
echo "BUS2 TEST-FAILED" >> /test/result/bus2.res
fi
+214
View File
@@ -0,0 +1,214 @@
#!/bin/sh
# Functionality:
# The EEPROM is write protected. The actual used i2c driver in the kernel
# only supports reading on the EEPROM.
# The test reads all EEPROM block contents. Each block should not be
# empty. This will be checked. If all eight blocks are read as not-empty,
# test passes.
# Hint: "ori" = ORIginal; "rb" = ReadBack; "res" = RESult; "err" = ERRor
#-----------------------------------------------------------------------------
# PREPERATIONS
#-----------------------------------------------------------------------------
# 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/eeprom.res ]
then
rm /test/result/eeprom.res
fi
# Make shure that error file of Test does NOT exists
if [ -s /test/result/eeprom.err ]
then
rm /test/result/eeprom.err
fi
# Make shure that Original file of Test does NOT exists
if [ -s /test/result/eeprom.ori ]
then
rm /test/result/eeprom.ori
fi
# Make shure that readback file of Test does NOT exists
if [ -s /test/result/eeprom.rb ]
then
rm /test/result/eeprom.rb
fi
#-----------------------------------------------------------------------------
# TEST
#-----------------------------------------------------------------------------
if [ ! -d /sys/bus/i2c/devices/0-0050 ]
then
# First Block in EEPROM not available - Write Message to result file
echo "FIRST Block unavailable" >> /test/result/eeprom.res
else
# First Block in EEPROM available - Check Size
if [ -s /sys/bus/i2c/devices/0-0050/eeprom ]
then
# File is available and its size greater zero - Test passed
echo -e "First Block OK"
else
# File is not available or its size is zero - Test failed
echo "First Block File error" >> /test/result/eeprom.res
fi
fi
if [ ! -d /sys/bus/i2c/devices/0-0051 ]
then
# Second Block in EEPROM not available - Write Message to result file
echo "Second Block unavailable" >> /test/result/eeprom.res
else
# Second Block in EEPROM available - Check Size
if [ -s /sys/bus/i2c/devices/0-0051/eeprom ]
then
# File is available and its size greater zero - Test passed
echo -e "Second Block OK"
else
# File is not available or its size is zero - Test failed
echo "Second Block File error" >> /test/result/eeprom.res
fi
fi
if [ ! -d /sys/bus/i2c/devices/0-0052 ]
then
# Third Block in EEPROM not available - Write Message to result file
echo "Third Block unavailable" >> /test/result/eeprom.res
else
# Third Block in EEPROM available - Check Size
if [ -s /sys/bus/i2c/devices/0-0052/eeprom ]
then
# File is available and its size greater zero - Test passed
echo -e "Third Block OK"
else
# File is not available or its size is zero - Test failed
echo "Third Block File error" >> /test/result/eeprom.res
fi
fi
if [ ! -d /sys/bus/i2c/devices/0-0053 ]
then
# Fourth Block in EEPROM not available - Write Message to result file
echo "Fourth Block unavailable" >> /test/result/eeprom.res
else
# Fourth Block in EEPROM available - Check Size
if [ -s /sys/bus/i2c/devices/0-0053/eeprom ]
then
# File is available and its size greater zero - Test passed
echo -e "Fourth Block OK"
else
# File is not available or its size is zero - Test failed
echo "Fourth Block File error" >> /test/result/eeprom.res
fi
fi
if [ ! -d /sys/bus/i2c/devices/0-0054 ]
then
# Fifth Block in EEPROM not available - Write Message to result file
echo "Fifth Block unavailable" >> /test/result/eeprom.res
else
# Fifth Block in EEPROM available - Check Size
if [ -s /sys/bus/i2c/devices/0-0054/eeprom ]
then
# File is available and its size greater zero - Test passed
echo -e "Fifth Block OK"
else
# File is not available or its size is zero - Test failed
echo "Fifth Block File error" >> /test/result/eeprom.res
fi
fi
if [ ! -d /sys/bus/i2c/devices/0-0055 ]
then
# Sixth Block in EEPROM not available - Write Message to result file
echo "Sixth Block unavailable" >> /test/result/eeprom.res
else
# Sixth Block in EEPROM available - Check Size
if [ -s /sys/bus/i2c/devices/0-0055/eeprom ]
then
# File is available and its size greater zero - Test passed
echo -e "Sixth Block OK"
else
# File is not available or its size is zero - Test failed
echo "Sixth Block File error" >> /test/result/eeprom.res
fi
fi
if [ ! -d /sys/bus/i2c/devices/0-0056 ]
then
# Seventh Block in EEPROM not available - Write Message to result file
echo "Seventh Block unavailable" >> /test/result/eeprom.res
else
# Seventh Block in EEPROM available - Check Size
if [ -s /sys/bus/i2c/devices/0-0056/eeprom ]
then
# File is available and its size greater zero - Test passed
echo -e "Seventh Block OK"
else
# File is not available or its size is zero - Test failed
echo "Seventh Block File error" >> /test/result/eeprom.res
fi
fi
if [ ! -d /sys/bus/i2c/devices/0-0057 ]
then
# Eigth Block in EEPROM not available - Write Message to result file
echo "Eigth Block unavailable" >> /test/result/eeprom.res
else
# Eigth Block in EEPROM available - Check Size
if [ -s /sys/bus/i2c/devices/0-0057/eeprom ]
then
# File is available and its size greater zero - Test passed
echo -e "Eigth Block OK"
else
# File is not available or its size is zero - Test failed
echo "Eigth Block File error" >> /test/result/eeprom.res
fi
fi
#-----------------------------------------------------------------------------
# OUTPUT AND RESULT CALCULATION
#-----------------------------------------------------------------------------
# Display content of /test/result/eeprom.res
if [ -s /test/result/eeprom.res ]
then
echo -e "\n\rContent of eeprom.res"
cat /test/result/eeprom.res
fi
# Display content of /test/result/eeprom.err
if [ -s /test/result/eeprom.err ]
then
echo -e "\n\rContent of eeprom.err"
cat /test/result/eeprom.err
fi
# If comparison returned neither results nor errors, the copying and
# comparision was successful
if [ ! -s /test/result/eeprom.res -a ! -s /test/result/eeprom.err ]
then
# Test was successful
echo -e "\n\rEEPROM TEST-PASSED"
echo "EEPROM TEST-PASSED" >> /test/result/eeprom.res
else
# Test failed
echo -e "\n\rEEPROM TEST-FAIL"
echo "EEPROM TEST-FAILED" >> /test/result/eeprom.res
fi
+49
View File
@@ -0,0 +1,49 @@
#!/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/eth0.res ]
then
rm /test/result/eth0.res
fi
# Make shure that error file of Test does NOT exists
if [ -s /test/result/eth0.err ]
then
rm /test/result/eth0.err
fi
# Ping Server in local network to make shure Ethernet Device works
# "-c 4": Send only 4 packages
# "-I eth0": Use Ethernet 0 as device
ping -c 4 -I eth0 192.168.1.2 1>> /test/result/eth0.res 2>> /test/result/eth0.err
# Display content of /test/result/usb2.res
echo -e "\n\rContent of eth0res"
cat /test/result/eth0.res
# Display content of /test/result/usb2.err
echo -e "\n\rContent of eth0.err"
cat /test/result/eth0.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/eth0.err ]
then
# Test was successful
echo -e "\n\rETHERNET 0 TEST-PASSED"
echo "ETHERNET 0 TEST-PASSED" >> /test/result/eth0.res
else
# Test failed
echo -e "\n\rETHERNET 0 TEST-FAIL"
echo "\n\rETHERNET 0 TEST-FAILED" >> /test/result/eth0.res
fi
+49
View File
@@ -0,0 +1,49 @@
#!/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
+4
View File
@@ -0,0 +1,4 @@
0123456789
9876543210
abcdefghijklmnopqrstuvwxyz
zyxwvutsrqponmlkjihgfedcba
+75
View File
@@ -0,0 +1,75 @@
#!/bin/sh
# Hint: "ori" = ORIginal; "rb" = ReadBack; "res" = RESult; "err" = ERRor
# Make shure that mounting Directory exists
if [ ! -d /mnt/usb1 ]
then
mkdir /mnt/usb1
fi
# 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/usb1.res ]
then
rm /test/result/usb1.res
fi
# Make shure that error file of Test does NOT exists
if [ -s /test/result/usb1.err ]
then
rm /test/result/usb1.err
fi
# Mount USB-Stick to /mnt/usb1
mount /dev/sda1 /mnt/usb1 2>> /test/result/usb1.err
# Copy Testfile from Test Directory to USB-Stick
cp /test/testfile /mnt/usb1 2>> /test/result/usb1.err
# Compare original Testfile and copied Testfile on USB-Stick
# Print compare results to /test/result/usb1.res
# Print compare errors to /test/result/usb1.err
if [ ! -e /mnt/usb1/testfile ]
then
echo "TESTFILE DOES NOT EXIST" >> /test/result/usb1.err
fi
diff /test/testfile /mnt/usb1/testfile 1>> /test/result/usb1.res
2>> /test/result/usb1.err
# Delete Testfile on USB-Stick
rm /mnt/usb1/testfile 2>> /test/result/usb1.err
# Unmount USB-Stick
umount /mnt/usb1 2>> /test/result/usb1.err
# Delete Folder usb1 in /mnt
rmdir /mnt/usb1 2>> /test/result/usb1.err
# Display content of /test/result/usb1.res
echo -e "\n\rContent of usb1.res"
cat /test/result/usb1.res
# Display content of /test/result/usb1.err
echo -e "\n\rContent of usb1.err"
cat /test/result/usb1.err
# If comparison returned neither results nor errors, the copying and comparision was successful
if [ ! -s /test/result/usb1.res -a ! -s /test/result/usb1.err ]
then
# Test was successful
echo -e "\n\rUSB1 TEST-PASSED"
echo "USB1 TEST-PASSED" >> /test/result/usb1.res
else
# Test failed
echo -e "\n\rUSB1 TEST-FAIL"
echo "USB1 TEST-FAILED" >> /test/result/usb1.res
fi
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
/* --------------------------------------------------------------------------- /* ---------------------------------------------------------------------------
+1 -1
View File
@@ -1 +1 @@
/* --------------------------------------------------------------------------- /* ---------------------------------------------------------------------------