Skip to content

Reverse Engineering / Authorized Penetration Testing / Security Research Skill Router Pack AI-powered routing + On-demand toolchain bootstrapping + Self-evolving knowledge base Supports Claude Code, Kiro, Cursor, Cline, and other AI coding clients 逆向/渗透/安全技能路由包 - AI 自动路由 + 按需自举工具链 + 自动进化经验库 | 支持 Claude Code / Kiro / Cursor / Cline 等代码 AI 客户端

Shell

test(ci): add dedicated bash workflow tests to CI (#116)

Max66cd74c99734
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 403f2b6..d2e4468 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -149,6 +149,7 @@ jobs:
set -euo pipefail
bash skills/scripts/test-routing.sh
bash skills/scripts/test-bootstrap-manifest.sh
+ bash skills/scripts/test-bash-workflow.sh
scratch="$(mktemp -d)"
trap 'rm -rf "$scratch"' EXIT
diff --git a/skills/scripts/test-bash-workflow.sh b/skills/scripts/test-bash-workflow.sh
new file mode 100755
index 0000000..89bcf17
--- /dev/null
+++ b/skills/scripts/test-bash-workflow.sh
@@ -0,0 +1,50 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+REPO_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"
+SCRATCH="$(mktemp -d)"
+trap 'rm -rf "$SCRATCH"' EXIT
+
+echo "=== Testing Bash Workflow ==="
+
+# Test 1: case-init.sh creates proper structure
+echo "[Test 1] case-init.sh basic execution"
+bash "$SCRIPT_DIR/case-init.sh" \
+ --hint "authorized web review" \
+ --case-name "test-bash-01" \
+ --package-root "$SCRATCH" \
+ --auth-granted \
+ --target-url "https://example.test/" \
+ --network-profile "authorized_target_only" > /dev/null
+
+if [ ! -f "$SCRATCH/work/test-bash-01/scope.md" ]; then
+ echo "FAIL: scope.md not created"
+ exit 1
+fi
+
+# Test 2: case-guard.sh validates valid scope
+echo "[Test 2] case-guard.sh accepts valid scope"
+if ! bash "$SCRIPT_DIR/case-guard.sh" --case-root "$SCRATCH/work/test-bash-01" > /dev/null; then
+ echo "FAIL: case-guard rejected valid scope"
+ exit 1
+fi
+
+# Test 3: case-guard.sh rejects invalid network mode
+echo "[Test 3] case-guard.sh rejects invalid network mode"
+sed -i 's/mode: authorized_target_only/mode: invalid_mode/g' "$SCRATCH/work/test-bash-01/scope.md"
+if bash "$SCRIPT_DIR/case-guard.sh" --case-root "$SCRATCH/work/test-bash-01" > /dev/null 2>&1; then
+ echo "FAIL: case-guard accepted invalid network mode"
+ exit 1
+fi
+
+# Test 4: case-guard.sh rejects ungranted auth
+echo "[Test 4] case-guard.sh rejects ungranted auth"
+sed -i 's/mode: invalid_mode/mode: authorized_target_only/g' "$SCRATCH/work/test-bash-01/scope.md"
+sed -i 's/status: granted/status: pending/g' "$SCRATCH/work/test-bash-01/scope.md"
+if bash "$SCRIPT_DIR/case-guard.sh" --case-root "$SCRATCH/work/test-bash-01" > /dev/null 2>&1; then
+ echo "FAIL: case-guard accepted pending auth"
+ exit 1
+fi
+
+echo "=== All Bash Workflow Tests Passed ==="