#!/bin/bash # Test script for streamlined help system (tldr + cheat, no navi) echo "๐Ÿงช Testing Streamlined Help System (TLDR + Cheat)" echo "=================================================" echo "" # Build the container echo "๐Ÿ—๏ธ Building streamlined container..." docker build -f Dockerfile.remnux -t tabledevil/file-analysis:streamlined . || { echo "โŒ Container build failed!" exit 1 } echo "โœ… Container built successfully" echo "" # Test basic help functions echo "๐Ÿ“‹ Testing basic help functions..." # Test 1: Main help echo " โ€ข Testing main help..." docker run --rm tabledevil/file-analysis:streamlined fhelp | head -10 | grep -q "File Analysis Container Help System" && { echo " โœ… Main help works" } || { echo " โŒ Main help failed" } # Test 2: PDF workflow echo " โ€ข Testing PDF workflow..." docker run --rm tabledevil/file-analysis:streamlined fhelp pdf | grep -q "pdfid.py" && { echo " โœ… PDF workflow works" } || { echo " โŒ PDF workflow failed" } # Test 3: Malware workflow echo " โ€ข Testing malware workflow..." docker run --rm tabledevil/file-analysis:streamlined fhelp malware | grep -q "capa" && { echo " โœ… Malware workflow works" } || { echo " โŒ Malware workflow failed" } # Test 4: Examples listing echo " โ€ข Testing examples listing..." docker run --rm tabledevil/file-analysis:streamlined fhelp examples | grep -q "pdfid" && { echo " โœ… Examples listing works" } || { echo " โŒ Examples listing failed" } echo "" # Test fhelp cheat functionality echo "๐Ÿ“‹ Testing fhelp cheat sheets..." CHEAT_TOOLS=("pdfid" "pdf-parser" "pdftk" "capa" "tar") for tool in "${CHEAT_TOOLS[@]}"; do echo " โ€ข Testing fhelp cheat $tool..." docker run --rm tabledevil/file-analysis:streamlined fhelp cheat "$tool" 2>/dev/null | head -5 | grep -q "Cheat Sheet" && { echo " โœ… fhelp cheat $tool works" } || { echo " โŒ fhelp cheat $tool failed" } done echo "" # Test TLDR functionality echo "๐Ÿ“– Testing TLDR functionality..." echo " โ€ข Testing standard tldr (tar)..." docker run --rm tabledevil/file-analysis:streamlined bash -c "export HOME=/home/remnux && tldr tar" 2>/dev/null | head -5 | grep -q "tar" && { echo " โœ… Standard tldr works" } || { echo " โŒ Standard tldr failed" } # Test custom analysis tools TLDR pages TLDR_TOOLS=("pdfid.py" "capa" "peepdf") for tool in "${TLDR_TOOLS[@]}"; do echo " โ€ข Testing tldr $tool..." docker run --rm tabledevil/file-analysis:streamlined bash -c "export HOME=/home/remnux && tldr '$tool'" 2>/dev/null | head -5 | grep -q "$tool" && { echo " โœ… tldr $tool works" } || { echo " โŒ tldr $tool failed" } done echo "" # Test tool availability echo "๐Ÿ› ๏ธ Testing analysis tools availability..." TOOLS=("pdfid.py" "pdf-parser.py" "peepdf" "pdftk" "capa" "strings" "exiftool" "file") for tool in "${TOOLS[@]}"; do echo " โ€ข Testing $tool availability..." docker run --rm tabledevil/file-analysis:streamlined bash -c "command -v '$tool' >/dev/null 2>&1" && { echo " โœ… $tool available" } || { echo " โŒ $tool not found" } done echo "" # Test file structure echo "๐Ÿ“ Testing help system file structure..." FILES=( "/opt/remnux-docs/tools.db" "/opt/cheatsheets/personal/pdfid" "/opt/cheatsheets/personal/pdf-analysis" "/home/remnux/.local/share/tldr/pages/common/pdfid.py.md" "/usr/local/bin/fhelp" "/usr/local/bin/find-tool" ) for file in "${FILES[@]}"; do echo " โ€ข Testing $file..." docker run --rm tabledevil/file-analysis:streamlined test -f "$file" && { echo " โœ… $file exists" } || { echo " โŒ $file missing" } done echo "" # Test offline capabilities echo "๐Ÿ”Œ Testing offline capabilities..." echo " โ€ข Testing fhelp --offline..." docker run --rm tabledevil/file-analysis:streamlined fhelp --offline | grep -q "Offline help system ready" && { echo " โœ… Offline status check works" } || { echo " โŒ Offline status check failed" } echo "" # Summary echo "๐Ÿ“Š Resource Summary:" docker run --rm tabledevil/file-analysis:streamlined bash -c " echo ' Cheat sheets:' \$(find /opt/cheatsheets/personal -type f 2>/dev/null | wc -l) echo ' TLDR pages:' \$(find /home/remnux/.local/share/tldr/pages/common -name '*.md' 2>/dev/null | wc -l) echo ' Analysis tools in PATH:' \$(echo 'pdfid.py pdf-parser.py peepdf pdftk capa' | tr ' ' '\n' | xargs -I {} sh -c 'command -v {} >/dev/null && echo found' | wc -l) " echo "" echo "๐ŸŽฏ Interactive Test Available:" echo " Run: docker run -it tabledevil/file-analysis:streamlined" echo " Then try:" echo " fhelp # Main help" echo " fhelp cheat pdfid # pdfid.py cheat sheet" echo " tldr capa # capa quick reference (if working)" echo " fhelp examples # List all available help" echo "" echo "๐Ÿ Streamlined help system testing complete!" echo " Review results above - navi removed, focusing on tldr + cheat reliability"