« Previous entry | Next entry » Browse > Snippets
Skip to comments (1)
test-script.sh for testing SFS
Posted by tjoconno on Feb 06 2007 @ 19:26 :: 3865 unique visits
CODE: BASH
#!/bin/bash
#Setup
echo This is an example > test.txt
rm -rf ../server/fs/*
echo 1. testing SFcat...
#SFScat
./SFScat -o/file1.txt < test.txt
./SFScat -o/echo.bin < /bin/echo
echo - diffing the results...
diff ../server/fs/file1.txt test.txt
diff ../server/fs/echo.bin /bin/echo
echo - nothing should have printed out...
sleep 1
echo 2. testing SFScp...
#SFScp
./SFScp /echo.bin /echov2.bin
./SFScp /file1.txt /file1v2.txt
./SFScp /echo.bin /echov3.bin
./SFScp /file1.txt /file1v3.txt
echo - diffing the results
diff ../server/fs/echo.bin ../server/fs/echov2.bin
diff ../server/fs/file1.txt ../server/fs/file1v2.txt
echo - nothing should have printed out...
sleep 1
echo 3. testing SFSmkdir...
#SFSmkdir
./SFSmkdir /dir1
./SFSmkdir /dir2
./SFSmkdir /dir3
./SFSmkdir /dir4
./SFSmkdir /dir1/subdir1
./SFSmkdir /dir1/subdir1/subsubdir1
./SFSmkdir /dir4/subdir1
echo - created directories
sleep 1
echo 4. testing SFSmv...
#SFSmv - for files
./SFSmv /file1v2.txt /dir1/file1.txt
./SFSmv /echov2.bin /dir2/echo.bin
echo - moved files
#SFmv - for directories
./SFSmv /dir1 /file_dir
./SFSmv /dir2 /bin_dir
./SFSmv /dir3 /big_dir
echo - moved directoreis
sleep 1
echo 5. testing SFSrm...
#SFSrm
./SFSrm /file1v3.txt
./SFSrm /echov3.bin
echo - removed files.
sleep 1
echo 6. testing SFSrmdir
#SFSrmdir
./SFSrmdir /dir4/subdir1
./SFSrmdir /dir4
echo - removed directories.
sleep 1
echo 7. testing SFSls...
#SFSls
./SFSls /file_dir > a.out
./SFSls /file_dir/subdir1 > b.out
./SFSls /file_dir/subdir1/subsubdir1 > c.out
./SFSls /file_dir/file1.txt > d.out
echo - diffing results -
diff a.out aa.out
diff b.out bb.out
diff c.out cc.out
diff d.out dd.out
sleep 1
echo 8. testing a df.
#SFSdf
./SFSdf > /dev/null
sleep 1
echo
echo - SEGMENTATION FAULT HUNTING COMMENCE -
echo - stderr,stdouput sent to /dev/null -
echo - ... just looking to cause segfault -
echo
echo 9. testing a long file name - 128 char... shouldnt crash.
# SFSCP TOO LONG FILENAME
./SFScp /1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij123456789 /a234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij123456789 >& /dev/null
sleep 1
echo 10. testing a long directory name - 512 char... shouldnt crash.
# SFSCP TOO LONG DIRECTORY NAME
./SFScp /file_dir/file1.txt /1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij12345678/1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij123456789/1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij123456789/1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij123456789 >& /dev/null
sleep 1
echo 11. testing a copy of a file that doesnt exist.. shouldnt crash.
# COPY FILE DOESN\'T EXIST
./SFScp /filethatdoesnotexist /anyfilewhatsoever >& /dev/null
sleep 1
echo 12. testing a SFScat for a file that does not exist output.. shouldnt crash
# CAT FILE DOESN\'T EXIST (WITH -A)
./SFScat -a/filethatdoesnotexist < test.txt >& /dev/null
sleep 1
echo 13. testing a SFSls for a dir that does not exist... shouldnt crash.
# SFSLS DIR DOESN\'T EXIST
./SFSls -l /directorythatdoesntexist >& /dev/null
sleep 1
echo 14. testing a SFSrmdir for dir that does not exist... shouldnt crash.
# SFSRMDIR DIRECTORY DOESN\'T EXIST
./SFSrmdir /directorythatdoesnotexist >& /dev/null
sleep 1
echo 15. testing a SFSmv for a dir that does not exist... shouldnt crash.
# SFSMV FILE DOESN\'T EXIST
./SFSmv /filetahtdoesnotexist /filethatdoesnotexist2 >&/dev/null
sleep 1
echo 16. testing a SFSrm for a file that does not exist... shouldnt crash.
# SFSRM FILE DOESN\'T EXIST
./SFSrm /filethatdoesnotexist >& /dev/null
sleep 1
rm -rf ../server/fs/*
rm a.out b.out c.out d.out
rm -rf test.txt
echo --- EOF ----
#Setup
echo This is an example > test.txt
rm -rf ../server/fs/*
echo 1. testing SFcat...
#SFScat
./SFScat -o/file1.txt < test.txt
./SFScat -o/echo.bin < /bin/echo
echo - diffing the results...
diff ../server/fs/file1.txt test.txt
diff ../server/fs/echo.bin /bin/echo
echo - nothing should have printed out...
sleep 1
echo 2. testing SFScp...
#SFScp
./SFScp /echo.bin /echov2.bin
./SFScp /file1.txt /file1v2.txt
./SFScp /echo.bin /echov3.bin
./SFScp /file1.txt /file1v3.txt
echo - diffing the results
diff ../server/fs/echo.bin ../server/fs/echov2.bin
diff ../server/fs/file1.txt ../server/fs/file1v2.txt
echo - nothing should have printed out...
sleep 1
echo 3. testing SFSmkdir...
#SFSmkdir
./SFSmkdir /dir1
./SFSmkdir /dir2
./SFSmkdir /dir3
./SFSmkdir /dir4
./SFSmkdir /dir1/subdir1
./SFSmkdir /dir1/subdir1/subsubdir1
./SFSmkdir /dir4/subdir1
echo - created directories
sleep 1
echo 4. testing SFSmv...
#SFSmv - for files
./SFSmv /file1v2.txt /dir1/file1.txt
./SFSmv /echov2.bin /dir2/echo.bin
echo - moved files
#SFmv - for directories
./SFSmv /dir1 /file_dir
./SFSmv /dir2 /bin_dir
./SFSmv /dir3 /big_dir
echo - moved directoreis
sleep 1
echo 5. testing SFSrm...
#SFSrm
./SFSrm /file1v3.txt
./SFSrm /echov3.bin
echo - removed files.
sleep 1
echo 6. testing SFSrmdir
#SFSrmdir
./SFSrmdir /dir4/subdir1
./SFSrmdir /dir4
echo - removed directories.
sleep 1
echo 7. testing SFSls...
#SFSls
./SFSls /file_dir > a.out
./SFSls /file_dir/subdir1 > b.out
./SFSls /file_dir/subdir1/subsubdir1 > c.out
./SFSls /file_dir/file1.txt > d.out
echo - diffing results -
diff a.out aa.out
diff b.out bb.out
diff c.out cc.out
diff d.out dd.out
sleep 1
echo 8. testing a df.
#SFSdf
./SFSdf > /dev/null
sleep 1
echo
echo - SEGMENTATION FAULT HUNTING COMMENCE -
echo - stderr,stdouput sent to /dev/null -
echo - ... just looking to cause segfault -
echo
echo 9. testing a long file name - 128 char... shouldnt crash.
# SFSCP TOO LONG FILENAME
./SFScp /1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij123456789 /a234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij123456789 >& /dev/null
sleep 1
echo 10. testing a long directory name - 512 char... shouldnt crash.
# SFSCP TOO LONG DIRECTORY NAME
./SFScp /file_dir/file1.txt /1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij12345678/1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij123456789/1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij123456789/1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij123456789 >& /dev/null
sleep 1
echo 11. testing a copy of a file that doesnt exist.. shouldnt crash.
# COPY FILE DOESN\'T EXIST
./SFScp /filethatdoesnotexist /anyfilewhatsoever >& /dev/null
sleep 1
echo 12. testing a SFScat for a file that does not exist output.. shouldnt crash
# CAT FILE DOESN\'T EXIST (WITH -A)
./SFScat -a/filethatdoesnotexist < test.txt >& /dev/null
sleep 1
echo 13. testing a SFSls for a dir that does not exist... shouldnt crash.
# SFSLS DIR DOESN\'T EXIST
./SFSls -l /directorythatdoesntexist >& /dev/null
sleep 1
echo 14. testing a SFSrmdir for dir that does not exist... shouldnt crash.
# SFSRMDIR DIRECTORY DOESN\'T EXIST
./SFSrmdir /directorythatdoesnotexist >& /dev/null
sleep 1
echo 15. testing a SFSmv for a dir that does not exist... shouldnt crash.
# SFSMV FILE DOESN\'T EXIST
./SFSmv /filetahtdoesnotexist /filethatdoesnotexist2 >&/dev/null
sleep 1
echo 16. testing a SFSrm for a file that does not exist... shouldnt crash.
# SFSRM FILE DOESN\'T EXIST
./SFSrm /filethatdoesnotexist >& /dev/null
sleep 1
rm -rf ../server/fs/*
rm a.out b.out c.out d.out
rm -rf test.txt
echo --- EOF ----
1. On Jul 14 2009 @ 08:11 guest wrote:
AVI to DVD Converter,AVI to DVD Creator,iPhone Ringtone Maker for Mac,AVI Converter OS X,VOB Converter OS X,AVCHD Video Converter,FLV Converter,PowerPoint Converter,AVCHD Converter,Blue-Ray ripper,Rip Blue Ray,FLV to MOV Mac,VOB to DVD,HD Video Converter,iPod Playlist Transfer