Print this page
Code review comments from pmooney (sundry), and igork (screwups in zonecfg refactoring)


  66     else
  67         grep -q "$expect" out.$$
  68         if (( $? != 0 )); then
  69             printf "%s: FAIL (error didn't match)\n" $name
  70             echo "Wanted:"
  71             echo "  $expect"
  72             echo "Got:"
  73             sed -e 's/^/  /' out.$$
  74             rm out.$$
  75             return 1;
  76         else
  77             rm out.$$
  78             printf  "%s: PASS\n" $name
  79             return 0
  80         fi
  81     fi
  82 }
  83 
  84 ret=0
  85 




  86 expect_success valid-full-config <<EOF
  87 add security-flags
  88 set lower=none
  89 set default=aslr
  90 set upper=all
  91 end
  92 EOF
  93 (( $? != 0 )) && ret=1
  94 
  95 expect_success valid-partial-config <<EOF
  96 add security-flags
  97 set default=aslr
  98 end
  99 EOF
 100 (( $? != 0 )) && ret=1
 101 
 102 expect_fail invalid-full-lower-gt-def "default secflags must be above the lower limit" <<EOF
 103 add security-flags
 104 set lower=aslr
 105 set default=none




  66     else
  67         grep -q "$expect" out.$$
  68         if (( $? != 0 )); then
  69             printf "%s: FAIL (error didn't match)\n" $name
  70             echo "Wanted:"
  71             echo "  $expect"
  72             echo "Got:"
  73             sed -e 's/^/  /' out.$$
  74             rm out.$$
  75             return 1;
  76         else
  77             rm out.$$
  78             printf  "%s: PASS\n" $name
  79             return 0
  80         fi
  81     fi
  82 }
  83 
  84 ret=0
  85 
  86 expect_success valid-no-config <<EOF
  87 EOF
  88 (( $? != 0 )) && ret=1
  89 
  90 expect_success valid-full-config <<EOF
  91 add security-flags
  92 set lower=none
  93 set default=aslr
  94 set upper=all
  95 end
  96 EOF
  97 (( $? != 0 )) && ret=1
  98 
  99 expect_success valid-partial-config <<EOF
 100 add security-flags
 101 set default=aslr
 102 end
 103 EOF
 104 (( $? != 0 )) && ret=1
 105 
 106 expect_fail invalid-full-lower-gt-def "default secflags must be above the lower limit" <<EOF
 107 add security-flags
 108 set lower=aslr
 109 set default=none