Home | History | Annotate | Download | only in smack
      1 #!/bin/sh
      2 #
      3 # Copyright (c) 2009 Casey Schaufler under the terms of the
      4 # GNU General Public License version 2, as published by the
      5 # Free Software Foundation
      6 #
      7 # Test setting of the CIPSO doi
      8 #
      9 # Environment:
     10 #	CAP_MAC_ADMIN
     11 #
     12 
     13 export TCID=smack_set_doi
     14 export TST_TOTAL=1
     15 
     16 . test.sh
     17 
     18 . smack_common.sh
     19 
     20 not_start_value="17"
     21 start_value=$(cat "$smackfsdir/doi" 2>/dev/null)
     22 
     23 echo "$not_start_value" 2>/dev/null > "$smackfsdir/doi"
     24 
     25 direct_value=$(cat "$smackfsdir/doi" 2>/dev/null)
     26 if [ "$direct_value" != "$not_start_value" ]; then
     27 	tst_brkm TFAIL "The CIPSO doi reported is \"$direct_value\", not the" \
     28 		       "expected \"$not_start_value\"."
     29 fi
     30 
     31 echo "$start_value" 2>/dev/null > "$smackfsdir/doi"
     32 
     33 direct_value=$(cat "$smackfsdir/doi" 2>/dev/null)
     34 if [ "$direct_value" != "$start_value" ]; then
     35 	tst_brkm TFAIL "The CIPSO doi reported is \"$direct_value\", not the" \
     36 		       "expected \"$start_value\"."
     37 fi
     38 
     39 tst_resm TPASS "Test \"$TCID\" success."
     40 tst_exit
     41