Don't require GCC_PLUGINS separately
[kconfig-hardened-check.git] / .woodpecker / functional_test.yml
index 4282e25efa62866c2839bb5edba3d6ff8682c1cf..17272f5fc4e86d8a23424cc677b0472ce3c6c3a7 100644 (file)
@@ -1,5 +1,5 @@
 # .woodpecker.yml
-pipeline:
+steps:
   installation-test:
     image: python:3
     pull: true
@@ -9,8 +9,26 @@ pipeline:
       - pwd
       - ls -la
       - python --version
-      - echo "Install package via pip..."
-      - pip --verbose install --no-cache-dir git+https://github.com/a13xp0p0v/kconfig-hardened-check
+      - echo "Install the package via pip..."
+      - pip --verbose install --no-cache-dir git+https://github.com/a13xp0p0v/kernel-hardening-checker
       - echo "Run the installed tool..."
-      - which kconfig-hardened-check
-      - kconfig-hardened-check
+      - which kernel-hardening-checker
+      - kernel-hardening-checker
+      - echo "Check all configs with the installed tool..."
+      - sysctl -a > /tmp/sysctls
+      - CONFIG_DIR=`find /usr/local/lib/ -name config_files`
+      - KCONFIGS=`find $CONFIG_DIR -type f | grep -e "\.config" -e "\.gz"`
+      - COUNT=0
+      - for C in $KCONFIGS; do COUNT=$(expr $COUNT + 1); echo ">>>>> checking kconfig number $COUNT <<<<<"; kernel-hardening-checker -c $C -l /proc/cmdline -s /tmp/sysctls; done
+      - echo "Have checked $COUNT kconfigs"
+  functional-test-with-coverage:
+    image: python:3
+    pull: true
+    commands:
+      - echo "Install the coverage tool..."
+      - python --version
+      - pip install --no-cache-dir coverage
+      - echo "Run the functional tests and collect the coverage..."
+      - sh .github/workflows/functional_test.sh
+      - echo "Show the coverage report..."
+      - coverage report