summaryrefslogtreecommitdiffstats
path: root/tests/cuckoo-test
blob: 4389665101dffb7481ea474541f7477aeb09ee30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash

source ${PTXDIST_WORKSPACE}/ptxconfig

case ${PTXCONF_ARCH_STRING} in
	arm)
		CPUVENDOR="ARM"
	;;
	i?86)
		CPUVENDOR="Intel"
	;;
	ppc)
		CPUVENDOR="PowerPC"
	;;
	sparc)
		CPUVENDOR="SPARC"
	;;
	mips)
		CPUVENDOR="MIPS"
	;;
	*)
		echo please add CPUVENDOR for PTXCONF_ARCH=${PTXCONF_ARCH_STRING} to Makefile
		exit 1
	;;
esac
cd $PTXDIST_WORKSPACE/root
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=${PTXCONF_COMPILER_PREFIX} '{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 "---"