浏览代码

Test STIG separately and with no output if all tests pass

Bob Mottram 8 年前
父节点
当前提交
0e47f66928
共有 1 个文件被更改,包括 13 次插入4 次删除
  1. 13
    4
      src/freedombone-tests

+ 13
- 4
src/freedombone-tests 查看文件

61
 }
61
 }
62
 
62
 
63
 function test_app_functions {
63
 function test_app_functions {
64
+    if [ $RUN_STIG ]; then
65
+        return
66
+    fi
64
     FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
67
     FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
65
 
68
 
66
     # check that these functions exist
69
     # check that these functions exist
78
 }
81
 }
79
 
82
 
80
 function test_unique_onion_ports {
83
 function test_unique_onion_ports {
84
+    if [ $RUN_STIG ]; then
85
+        return
86
+    fi
87
+
81
     # test that some services are not assigned the same onion port
88
     # test that some services are not assigned the same onion port
82
     FILES=src/${PROJECT_NAME}-app-*
89
     FILES=src/${PROJECT_NAME}-app-*
83
     ports=$(grep -r "_ONION_PORT=" $FILES | awk -F ':' '{print $2}' | uniq | awk -F '=' '{print $2}')
90
     ports=$(grep -r "_ONION_PORT=" $FILES | awk -F ':' '{print $2}' | uniq | awk -F '=' '{print $2}')
1093
     output "V-58901" $? ${SETLANG}
1100
     output "V-58901" $? ${SETLANG}
1094
     ################
1101
     ################
1095
 
1102
 
1096
-    echo ''
1097
-    echo "Passes: $PASSES"
1098
-    echo "Fails:  $FAILS"
1099
     if [ $FAILS -gt 0 ]; then
1103
     if [ $FAILS -gt 0 ]; then
1100
-        exit 792353
1104
+        echo ''
1105
+        echo "Passes: $PASSES"
1106
+        echo "Fails:  $FAILS"
1107
+        if [ $FAILS -gt 0 ]; then
1108
+            exit 792353
1109
+        fi
1101
     fi
1110
     fi
1102
 }
1111
 }
1103
 
1112