feat: add README.md to each lab with startup instructions and remove obsolete version from compose files
This commit is contained in:
@@ -5,11 +5,11 @@ type: execute
|
||||
wave: 0
|
||||
depends_on: []
|
||||
files_modified:
|
||||
- labs/lab-01-iam/tests/test-01-user-creation.sh
|
||||
- labs/lab-01-iam/tests/test-02-docker-access.sh
|
||||
- labs/lab-01-iam/tests/03-non-root-test.sh
|
||||
- labs/lab-01-iam/tests/99-final-verification.sh
|
||||
- labs/lab-01-iam/tests/run-all-tests.sh
|
||||
- labs/lab-01-iam/tests/99-final-verification.sh
|
||||
- labs/lab-01-iam/tests/99-final-verification.sh
|
||||
- labs/lab-01-iam/tests/99-final-verification.sh
|
||||
- labs/lab-01-iam/tests/99-final-verification.sh
|
||||
autonomous: true
|
||||
requirements: [TEST-01, TEST-05, INF-01]
|
||||
user_setup: []
|
||||
@@ -20,24 +20,24 @@ must_haves:
|
||||
- "Final verification script runs all checks for student self-validation"
|
||||
- "Test harness can be executed with single command"
|
||||
artifacts:
|
||||
- path: "labs/lab-01-iam/tests/test-01-user-creation.sh"
|
||||
- path: "labs/lab-01-iam/tests/99-final-verification.sh"
|
||||
provides: "User and group creation validation"
|
||||
min_lines: 40
|
||||
- path: "labs/lab-01-iam/tests/test-02-docker-access.sh"
|
||||
- path: "labs/lab-01-iam/tests/99-final-verification.sh"
|
||||
provides: "Docker socket access control validation"
|
||||
min_lines: 30
|
||||
- path: "labs/lab-01-iam/tests/03-non-root-test.sh"
|
||||
- path: "labs/lab-01-iam/tests/99-final-verification.sh"
|
||||
provides: "Non-root container verification (INF-01)"
|
||||
min_lines: 35
|
||||
- path: "labs/lab-01-iam/tests/99-final-verification.sh"
|
||||
provides: "Final double-check command for students"
|
||||
min_lines: 25
|
||||
- path: "labs/lab-01-iam/tests/run-all-tests.sh"
|
||||
- path: "labs/lab-01-iam/tests/99-final-verification.sh"
|
||||
provides: "Test suite orchestration"
|
||||
min_lines: 15
|
||||
key_links:
|
||||
- from: "run-all-tests.sh"
|
||||
to: "test-01-user-creation.sh, test-02-docker-access.sh, 03-non-root-test.sh, 99-final-verification.sh"
|
||||
- from: "99-final-verification.sh"
|
||||
to: "99-final-verification.sh, 99-final-verification.sh, 99-final-verification.sh, 99-final-verification.sh"
|
||||
via: "Sequential execution with exit code handling"
|
||||
pattern: "bash.*tests/.*\\.sh"
|
||||
---
|
||||
@@ -105,15 +105,15 @@ echo "PASS: All containers running as non-root"
|
||||
## Test Framework from RESEARCH.md
|
||||
- Framework: BASH (Bourne Again Shell) >= 4.0
|
||||
- No config file needed - inline test functions
|
||||
- Quick run: `bash labs/lab-01-iam/tests/quick-test.sh`
|
||||
- Full suite: `bash labs/lab-01-iam/tests/run-all-tests.sh`
|
||||
- Quick run: `bash labs/lab-01-iam/tests/99-final-verification.sh`
|
||||
- Full suite: `bash labs/lab-01-iam/tests/99-final-verification.sh`
|
||||
</context>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto" tdd="true">
|
||||
<name>Task 1: Create user creation test script</name>
|
||||
<files>labs/lab-01-iam/tests/test-01-user-creation.sh</files>
|
||||
<files>labs/lab-01-iam/tests/99-final-verification.sh</files>
|
||||
<behavior>
|
||||
- Test 1: Non-existent user returns appropriate failure
|
||||
- Test 2: User not in docker group cannot access Docker socket
|
||||
@@ -207,14 +207,14 @@ Key implementation points:
|
||||
- Return proper exit codes (0=pass, 1=fail)
|
||||
</action>
|
||||
<verify>
|
||||
<automated>chmod +x labs/lab-01-iam/tests/test-01-user-creation.sh && bash labs/lab-01-iam/tests/test-01-user-creation.sh</automated>
|
||||
<automated>chmod +x labs/lab-01-iam/tests/99-final-verification.sh && bash labs/lab-01-iam/tests/99-final-verification.sh</automated>
|
||||
</verify>
|
||||
<done>Script exists, is executable, and tests user/group creation behavior</done>
|
||||
</task>
|
||||
|
||||
<task type="auto" tdd="true">
|
||||
<name>Task 2: Create Docker access control test script</name>
|
||||
<files>labs/lab-01-iam/tests/test-02-docker-access.sh</files>
|
||||
<files>labs/lab-01-iam/tests/99-final-verification.sh</files>
|
||||
<behavior>
|
||||
- Test 1: User in docker group can execute docker ps
|
||||
- Test 2: User in docker group can run basic containers
|
||||
@@ -321,14 +321,14 @@ Key implementation points:
|
||||
- Test mechanism for adding users to docker group
|
||||
</action>
|
||||
<verify>
|
||||
<automated>chmod +x labs/lab-01-iam/tests/test-02-docker-access.sh && bash labs/lab-01-iam/tests/test-02-docker-access.sh</automated>
|
||||
<automated>chmod +x labs/lab-01-iam/tests/99-final-verification.sh && bash labs/lab-01-iam/tests/99-final-verification.sh</automated>
|
||||
</verify>
|
||||
<done>Script validates Docker socket access control mechanisms</done>
|
||||
</task>
|
||||
|
||||
<task type="auto" tdd="true">
|
||||
<name>Task 3: Create non-root container verification script (INF-01)</name>
|
||||
<files>labs/lab-01-iam/tests/03-non-root-test.sh</files>
|
||||
<files>labs/lab-01-iam/tests/99-final-verification.sh</files>
|
||||
<behavior>
|
||||
- Test 1: Container configured with USER directive runs as non-root
|
||||
- Test 2: docker exec whoami returns non-root user
|
||||
@@ -501,7 +501,7 @@ Key implementation points:
|
||||
- Check all services in docker-compose.yml for compliance
|
||||
</action>
|
||||
<verify>
|
||||
<automated>chmod +x labs/lab-01-iam/tests/03-non-root-test.sh && bash labs/lab-01-iam/tests/03-non-root-test.sh</automated>
|
||||
<automated>chmod +x labs/lab-01-iam/tests/99-final-verification.sh && bash labs/lab-01-iam/tests/99-final-verification.sh</automated>
|
||||
</verify>
|
||||
<done>Script verifies INF-01: no container runs as root</done>
|
||||
</task>
|
||||
@@ -687,7 +687,7 @@ Key implementation points:
|
||||
|
||||
<task type="auto" tdd="true">
|
||||
<name>Task 5: Create test orchestration script</name>
|
||||
<files>labs/lab-01-iam/tests/run-all-tests.sh</files>
|
||||
<files>labs/lab-01-iam/tests/99-final-verification.sh</files>
|
||||
<behavior>
|
||||
- Test 1: Script executes all test files in sequence
|
||||
- Test 2: Script stops on first failure (fail-fast)
|
||||
@@ -701,7 +701,7 @@ Create test orchestration script:
|
||||
#!/bin/bash
|
||||
# Test Suite Runner: Lab 01 - IAM & Sicurezza
|
||||
# Runs all tests in sequence and provides summary
|
||||
# Usage: bash labs/lab-01-iam/tests/run-all-tests.sh
|
||||
# Usage: bash labs/lab-01-iam/tests/99-final-verification.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
@@ -722,9 +722,9 @@ echo ""
|
||||
|
||||
# Array of test files in order
|
||||
declare -a tests=(
|
||||
"$TEST_DIR/test-01-user-creation.sh"
|
||||
"$TEST_DIR/test-02-docker-access.sh"
|
||||
"$TEST_DIR/03-non-root-test.sh"
|
||||
"$TEST_DIR/99-final-verification.sh"
|
||||
"$TEST_DIR/99-final-verification.sh"
|
||||
"$TEST_DIR/99-final-verification.sh"
|
||||
)
|
||||
|
||||
total_tests=${#tests[@]}
|
||||
@@ -780,7 +780,7 @@ Key implementation points:
|
||||
- Can be run from any directory (uses absolute paths)
|
||||
</action>
|
||||
<verify>
|
||||
<automated>chmod +x labs/lab-01-iam/tests/run-all-tests.sh && bash labs/lab-01-iam/tests/run-all-tests.sh</automated>
|
||||
<automated>chmod +x labs/lab-01-iam/tests/99-final-verification.sh && bash labs/lab-01-iam/tests/99-final-verification.sh</automated>
|
||||
</verify>
|
||||
<done>Orchestration script runs all tests and provides summary</done>
|
||||
</task>
|
||||
|
||||
Reference in New Issue
Block a user