Changeset 2195

Show
Ignore:
Timestamp:
05/28/08 13:13:19 (6 months ago)
Author:
apatel
Message:

Updated fnet test case to diff against generated fnet to expected output. Note that pass key and auth key are dynamic and have been excluded from the diff using regex.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/test/test0134

    • Property svn:ignore set to
      test.*
  • trunk/test/test0134/README

    r2185 r2195  
     1Test should run without error. 
    12Create in memory network data structure and then pass it to the FNetGenerator to produce the fnet file. 
    23 
  • trunk/test/test0134/test.sh

    r2185 r2195  
    44 
    55RESULT=0 
    6 # LIBSELINUX needs to be passed in as the full path to libselinuxjava.so 
     6 
     7diff_fnet_files() 
     8
     9        expected_output=$DIR/expected.fnet 
     10        generated_output=$DIR/test.fnet 
     11        diff_file=$DIR/test.diff 
     12        `diff --ignore-matching-lines="networkresource guard_out {ipsec ( 3des.*"  $expected_output $generated_output > $diff_file`  
     13        if [ -e $diff_file ]; then 
     14                different_lines=`wc -l $diff_file | cut -f 1 -d ' '` 
     15                if [ $different_lines -gt 0 ]; then 
     16                        RESULT=1 
     17                fi; 
     18        else 
     19                RESULT=1 
     20        fi; 
     21
    722 
    823#run the compiler test 
    9 java -cp build com.tresys.framework.compiler.Compiler -fnetgeneration  $DIR/test.fnet -pc test/basepolicy/ -ds framework-plugin/resources/dictionary/dictionary.fdic -lib $LIBSELINUX > $DIR/test.out 2> $DIR/test.err 
     24java -cp build com.tresys.framework.compiler.Test -fnet  $DIR/test.fnet > $DIR/test.out 2> $DIR/test.err 
    1025 
    1126 
    1227#check compiler error result 
    13 #if [ $? -ne 1 ]; then 
    14 #     echo Unexpected error during compilation  
    15 #     RESULT=1 
    16 #fi; 
     28if [ $? -ne 0 ]; then 
     29      echo Unexpected error during compilation  
     30      RESULT=1 
     31fi; 
    1732 
    1833 
     
    3853                RESULT=1 
    3954        fi; 
     55         
     56        if [ $RESULT -ne 1 ]; then 
     57                diff_fnet_files 
     58        fi; 
    4059fi; 
    4160 
     
    4564fi; 
    4665 
     66 
     67 
     68 
    4769return $RESULT 
     70