diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/cuckoo-test | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/tests/cuckoo-test b/tests/cuckoo-test new file mode 100755 index 000000000..ab60a56cd --- /dev/null +++ b/tests/cuckoo-test @@ -0,0 +1,70 @@ +#! /bin/sh + +if [ $# != 3 ]; then + echo "usage: $0 <arch> <root-path> <arch-prefix>" + exit 1 +fi + +case $1 in + arm) + CPUVENDOR="ARM" + ;; + i?86) + CPUVENDOR="Intel" + ;; + ppc) + CPUVENDOR="PowerPC" + ;; + sparc) + CPUVENDOR="SPARC" + ;; + mips) + CPUVENDOR="MIPS" + ;; + *) + @echo please add CPUVENDOR to Makefile + exit 1 + ;; +esac +cd $2 +echo +echo $CPUVENDOR cuckoo test + +echo "1 pass (egg test)" +find . -type f -a \! -path "*share/terminfo*" -exec file {} \; | sed \ +-e "s/ASCII.*/+++OK+++/" \ +-e "s/Bourne.*executable/+++OK+++/" \ +-e "s/empty/+++OK+++/" \ +-e "s/Bourne.*text/+++OK+++/" \ +-e "s/PPCBoot.*/+++OK+++/" \ +-e "s/ELF.*$CPUVENDOR.*/+++OK+++/" \ +-e "s/FIGlet.*/+++OK+++/" \ +-e "s/python script.*/+++OK+++/" \ +-e "s/Berkeley DB.*/+++OK+++/" \ +-e "s/Compiled terminfo entry.*/+++OK+++/" \ +-e "s/python.*byte-compiled.*/+++OK+++/" \ +-e "s/data/+++OK+++/" \ +-e "s/MPEG.*/+++OK+++/" \ +-e "s/XML.*/+++OK+++/" \ +-e "s/.*\.qpf/+++OK+++/" \ +-e "s/exported SGML document text/+++OK+++/" \ +-e "s/.*\.bin: $/+++OK+++/" \ + | \ +grep -v "+++OK+++" | \ +awk -F, '{print substr($1, 1, index($1,":"))" wrong architecture! ("$2")"}' +echo "---" + +echo "2 pass (fluff up test)" +find . -type f -exec file {} \; | grep -v "\.ko" | grep -v ".*\.qpf" | grep "not stripped" | +awk -F: '{print $1" not stripped"}' +echo "---" + +echo "3 pass (in laws test)" + +find . -type f -exec file {} \; | \ +awk -F: -vARCH=$3 '{if (index($2,"ELF")) print ARCH"readelf -d "$1}' | \ +sh | grep "(NEEDED)" | \ +awk '{gsub("\\[","");gsub("\\]","");print "if [ \"x$(find . -name "$5")\" = \"x\" ]; then echo "$5" not found ; fi"}' | \ +sort -u | sh + +echo "---" |