Changeset 2571

Show
Ignore:
Timestamp:
01/07/08 13:29:47 (1 year ago)
Author:
pebenito
Message:

tools: print test suite in error messages.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/external-buildtest.sh

    r2413 r2571  
    114114einfo "Building conf (extref; mon)" 
    115115$SANDBOX make -C $START conf || die "Failed make conf (extref; mon)" 
    116 grep -q ^testapp policy/modules.conf || die "testapp missing from modules.conf
    117 grep -q ^testsrv policy/modules.conf || die "testsrv missing from modules.conf
    118 grep -q '^test ' policy/modules.conf || die "test missing from modules.conf
     116grep -q ^testapp policy/modules.conf || die "testapp missing from modules.conf (extref; mon)
     117grep -q ^testsrv policy/modules.conf || die "testsrv missing from modules.conf (extref; mon)
     118grep -q '^test ' policy/modules.conf || die "test missing from modules.conf (extref; mon)
    119119einfo "Building fc_sort" 
    120120# need to figure out why this gets "Aborted" when run in sandbox 
    121121make -C $START ${LOCAL_ROOT}/tmp/fc_sort || die 
    122122einfo "Building policy (extref; mon)" 
    123 $SANDBOX make -C $START policy || die "failed building policy
    124 grep -q 'type test_t;' policy.conf || die "test_t missing from policy.conf
    125 grep -q 'type testapp_t;' policy.conf || die "testapp_t missing from policy.conf
    126 grep -q 'type testsrv_t;' policy.conf || die "testsrv_t missing from policy.conf
    127 [ -f policy.20 ] || die "policy.20 is missing
    128 $SANDBOX make -C $START ${LOCAL_ROOT}/file_contexts || die "failed building file_contexts
    129 [ -f file_contexts ] || die "file_contexts is missing
     123$SANDBOX make -C $START policy || die "failed building policy (extref; mon)
     124grep -q 'type test_t;' policy.conf || die "test_t missing from policy.conf (extref; mon)
     125grep -q 'type testapp_t;' policy.conf || die "testapp_t missing from policy.conf (extref; mon)
     126grep -q 'type testsrv_t;' policy.conf || die "testsrv_t missing from policy.conf (extref; mon)
     127[ -f policy.20 ] || die "policy.20 is missing (extref; mon)
     128$SANDBOX make -C $START ${LOCAL_ROOT}/file_contexts || die "failed building file_contexts (extref; mon)
     129[ -f file_contexts ] || die "file_contexts is missing (extref; mon)
    130130if [ ! -z "$SANDBOX" ]; then 
    131131        einfo "Touch test--this should fail (extref; mod)" 
    132         $SANDBOX touch $START/EPERM && die "Touch test failed
     132        $SANDBOX touch $START/EPERM && die "Touch test failed (extref; mon)
    133133fi 
    134134einfo "Cleaning up (extref; mon)" 
     
    145145einfo "Building conf (extref; mod)" 
    146146$SANDBOX make -C $START conf || die 
    147 grep -q ^testapp policy/modules.conf || die "testapp missing from modules.conf
    148 grep -q ^testsrv policy/modules.conf || die "testsrv missing from modules.conf
     147grep -q ^testapp policy/modules.conf || die "testapp missing from modules.conf (extref; mod)
     148grep -q ^testsrv policy/modules.conf || die "testsrv missing from modules.conf (extref; mod)
    149149einfo "Building fc_sort" 
    150150# need to figure out why this gets "Aborted" when run in sandbox 
    151151make -C $START ${LOCAL_ROOT}/tmp/fc_sort || die 
    152152einfo "Building all policy (extref; mod)" 
    153 $SANDBOX make -C $START base || die "failed building base module
    154 [ -f base.pp ] || die "base.pp is missing
    155 $SANDBOX make -C $START modules || die "failed building all modules
    156 [ -f apache.pp ] || die "apache.pp is missing
    157 [ -f testapp.pp ] || die "testapp.pp is missing
    158 einfo "Verifying policy linking
    159 $SANDBOX make -C $START validate || die "failed validating linking
     153$SANDBOX make -C $START base || die "failed building base module (extref; mod)
     154[ -f base.pp ] || die "base.pp is missing (extref; mod)
     155$SANDBOX make -C $START modules || die "failed building all modules (extref; mod)
     156[ -f apache.pp ] || die "apache.pp is missing (extref; mod)
     157[ -f testapp.pp ] || die "testapp.pp is missing (extref; mod)
     158einfo "Verifying policy linking (extref; mod)
     159$SANDBOX make -C $START validate || die "failed validating linking (extref; mod)
    160160$SANDBOX make -C $START clean || die 
    161161einfo "Building policy by name (extref; mod)" 
    162 $SANDBOX make -C $START ${LOCAL_ROOT}/apache.pp ${LOCAL_ROOT}/testapp.pp || die "Failed building modules by name
    163 [ -f apache.pp ] || die "apache.pp is missing
    164 [ -f testapp.pp ] || die "testapp.pp is missing
     162$SANDBOX make -C $START ${LOCAL_ROOT}/apache.pp ${LOCAL_ROOT}/testapp.pp || die "Failed building modules by name (extref; mod)
     163[ -f apache.pp ] || die "apache.pp is missing (extref; mod)
     164[ -f testapp.pp ] || die "testapp.pp is missing (extref; mod)
    165165# need to figure out why this gets "Aborted" when run in sandbox 
    166166make -C $START ${LOCAL_ROOT}/tmp/fc_sort || die 
    167 $SANDBOX make -C $START ${LOCAL_ROOT}/base.pp || die "Failed building base by name
    168 [ -f base.pp ] || die "base.pp is missing
     167$SANDBOX make -C $START ${LOCAL_ROOT}/base.pp || die "Failed building base by name (extref; mod)
     168[ -f base.pp ] || die "base.pp is missing (extref; mod)
    169169if [ ! -z "$SANDBOX" ]; then 
    170170        einfo "Touch test--this should fail (extref; mod)" 
    171         $SANDBOX touch $START/EPERM && die "Touch test failed
     171        $SANDBOX touch $START/EPERM && die "Touch test failed (extref; mod)
    172172fi 
    173173einfo "Cleaning up (extref; mod)" 
     
    182182################# headers build (flat) 
    183183einfo "Installing headers (headers; flat)" 
    184 make DESTDIR=$BOX install-headers || die "Failed to install headers
     184make DESTDIR=$BOX install-headers || die "Failed to install headers (headers; flat)
    185185mkdir $BOX/policy 
    186186cp doc/example.* $BOX/policy 
     
    189189cd ${BOX}/policy 
    190190einfo "Building all policy (headers; flat)" 
    191 $SANDBOX make QUIET=n NAME=refpolicy all || die "Failed to build all policy
    192 [ -f example.pp ] || die "example.pp is missing
     191$SANDBOX make QUIET=n NAME=refpolicy all || die "Failed to build all policy (headers; flat)
     192[ -f example.pp ] || die "example.pp is missing (headers; flat)
    193193$SANDBOX make QUIET=n NAME=refpolicy clean 
    194194einfo "Building policy by name (headers; flat)" 
    195 $SANDBOX make QUIET=n NAME=refpolicy example.pp || die "Failed to build by name
    196 [ -f example.pp ] || die "example.pp is missing
     195$SANDBOX make QUIET=n NAME=refpolicy example.pp || die "Failed to build by name (headers; flat)
     196[ -f example.pp ] || die "example.pp is missing (headers; flat)
    197197einfo "Building XML (headers; flat)" 
    198 $SANDBOX make QUIET=n NAME=refpolicy xml || die "Failed to build XML
    199 grep -q '<layer name="third_party">' doc/policy.xml || die "third_party layer missing from XML
    200 grep -q '<layer name="kernel">' doc/policy.xml || die "kernel layer missing from XML
    201 egrep -q '<module name="example" .*>' doc/policy.xml || die "example module missing from XML
    202 egrep -q '<module name="apache" .*>' doc/policy.xml || die "apache module missing from XML
     198$SANDBOX make QUIET=n NAME=refpolicy xml || die "Failed to build XML (headers; flat)
     199grep -q '<layer name="third_party">' doc/policy.xml || die "third_party layer missing from XML (headers; flat)
     200grep -q '<layer name="kernel">' doc/policy.xml || die "kernel layer missing from XML (headers; flat)
     201egrep -q '<module name="example" .*>' doc/policy.xml || die "example module missing from XML (headers; flat)
     202egrep -q '<module name="apache" .*>' doc/policy.xml || die "apache module missing from XML (headers; flat)
    203203if [ ! -z "$SANDBOX" ]; then 
    204204        einfo "Touch test--this should fail (headers; flat)" 
     
    219219einfo "Building all policy (headers; layered)" 
    220220$SANDBOX make QUIET=n NAME=refpolicy SHAREDIR=$BOX/usr/share/selinux all || die 
    221 [ -f testsrv.pp ] || die "testsrv.pp is missing
    222 [ -f test.pp ] || die "test.pp is missing
     221[ -f testsrv.pp ] || die "testsrv.pp is missing (headers; layered)
     222[ -f test.pp ] || die "test.pp is missing (headers; layered)
    223223$SANDBOX make QUIET=n NAME=refpolicy SHAREDIR=$BOX/usr/share/selinux clean || die 
    224224einfo "Building policy by name (headers; layered and flat)" 
    225225$SANDBOX make QUIET=n NAME=refpolicy SHAREDIR=$BOX/usr/share/selinux testsrv.pp test.pp || die 
    226 [ -f testsrv.pp ] || die "testsrv.pp is missing
    227 [ -f test.pp ] || die "test.pp is missing
    228 einfo "Building XML (headers; layered)
     226[ -f testsrv.pp ] || die "testsrv.pp is missing (headers; layered)
     227[ -f test.pp ] || die "test.pp is missing (headers; layered)
     228einfo "Building XML (headers; layered) (headers; layered)
    229229$SANDBOX make QUIET=n NAME=refpolicy SHAREDIR=$BOX/usr/share/selinux xml || die 
    230 grep -q '<layer name="kernel">' doc/policy.xml || die "kernel layer missing from XML
    231 grep -q '<layer name="test">' doc/policy.xml || die "test layer missing from XML
    232 egrep -q '<module name="test" .*>' doc/policy.xml || die "test module missing from XML
    233 egrep -q '<module name="testsrv" .*>' doc/policy.xml || die "testsrv module missing from XML
    234 egrep -q '<module name="testapp" .*>' doc/policy.xml || die "testapp module missing from XML
    235 egrep -q '<module name="apache" .*>' doc/policy.xml || die "apache module missing from XML
     230grep -q '<layer name="kernel">' doc/policy.xml || die "kernel layer missing from XML (headers; layered)
     231grep -q '<layer name="test">' doc/policy.xml || die "test layer missing from XML (headers; layered)
     232egrep -q '<module name="test" .*>' doc/policy.xml || die "test module missing from XML (headers; layered)
     233egrep -q '<module name="testsrv" .*>' doc/policy.xml || die "testsrv module missing from XML (headers; layered)
     234egrep -q '<module name="testapp" .*>' doc/policy.xml || die "testapp module missing from XML (headers; layered)
     235egrep -q '<module name="apache" .*>' doc/policy.xml || die "apache module missing from XML (headers; layered)
    236236if [ ! -z "$SANDBOX" ]; then 
    237237        einfo "Touch test--this should fail (headers; layered)" 
     
    243243 
    244244################# headers build (layered and flat) 
    245 einfo "Installing headers (layered and flat)" 
     245einfo "Installing headers (headers; layered and flat)" 
    246246make DESTDIR=$BOX install-headers 
    247247mkdir $BOX/policy 
     
    253253einfo "Building all policy (headers; layered and flat)" 
    254254$SANDBOX make QUIET=n NAME=refpolicy SHAREDIR=$BOX/usr/share/selinux all || die 
    255 [ -f example.pp ] || die "example.pp is missing
    256 [ -f testapp.pp ] || die "testapp.pp is missing
    257 [ -f testsrv.pp ] || die "testsrv.pp is missing
    258 [ -f test.pp ] || die "test.pp is missing
     255[ -f example.pp ] || die "example.pp is missing (headers; layered and flat)
     256[ -f testapp.pp ] || die "testapp.pp is missing (headers; layered and flat)
     257[ -f testsrv.pp ] || die "testsrv.pp is missing (headers; layered and flat)
     258[ -f test.pp ] || die "test.pp is missing (headers; layered and flat)
    259259$SANDBOX make QUIET=n NAME=refpolicy SHAREDIR=$BOX/usr/share/selinux clean || die 
    260260einfo "Building policy by name (headers; layered and flat)" 
    261261$SANDBOX make QUIET=n NAME=refpolicy SHAREDIR=$BOX/usr/share/selinux test.pp example.pp testapp.pp || die 
    262 [ -f testapp.pp ] || die "testapp.pp is missing
    263 [ -f test.pp ] || die "test.pp is missing
     262[ -f testapp.pp ] || die "testapp.pp is missing (headers; layered and flat)
     263[ -f test.pp ] || die "test.pp is missing (headers; layered and flat)
    264264einfo "Building XML (headers; layered and flat)" 
    265265$SANDBOX make QUIET=n NAME=refpolicy SHAREDIR=$BOX/usr/share/selinux xml || die 
    266 grep -q '<layer name="kernel">' doc/policy.xml || die "kernel layer missing from XML
    267 grep -q '<layer name="test">' doc/policy.xml || die "test layer missing from XML
    268 grep -q '<layer name="third_party">' doc/policy.xml || die "third_party layer missing from XML
    269 egrep -q '<module name="test" .*>' doc/policy.xml || die "test module missing from XML
    270 egrep -q '<module name="testsrv" .*>' doc/policy.xml || die "testsrv module missing from XML
    271 egrep -q '<module name="testapp" .*>' doc/policy.xml || die "testapp module missing from XML
    272 egrep -q '<module name="apache" .*>' doc/policy.xml || die "apache module missing from XML
    273 egrep -q '<module name="example" .*>' doc/policy.xml || die "example module missing from XML
     266grep -q '<layer name="kernel">' doc/policy.xml || die "kernel layer missing from XML (headers; layered and flat)
     267grep -q '<layer name="test">' doc/policy.xml || die "test layer missing from XML (headers; layered and flat)
     268grep -q '<layer name="third_party">' doc/policy.xml || die "third_party layer missing from XML (headers; layered and flat)
     269egrep -q '<module name="test" .*>' doc/policy.xml || die "test module missing from XML (headers; layered and flat)
     270egrep -q '<module name="testsrv" .*>' doc/policy.xml || die "testsrv module missing from XML (headers; layered and flat)
     271egrep -q '<module name="testapp" .*>' doc/policy.xml || die "testapp module missing from XML (headers; layered and flat)
     272egrep -q '<module name="apache" .*>' doc/policy.xml || die "apache module missing from XML (headers; layered and flat)
     273egrep -q '<module name="example" .*>' doc/policy.xml || die "example module missing from XML (headers; layered and flat)
    274274if [ ! -z "$SANDBOX" ]; then 
    275275        einfo "Touch test--this should fail (headers; layered and flat)"