summaryrefslogtreecommitdiff
path: root/scripts/testing/run-test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/testing/run-test.sh')
-rwxr-xr-xscripts/testing/run-test.sh86
1 files changed, 33 insertions, 53 deletions
diff --git a/scripts/testing/run-test.sh b/scripts/testing/run-test.sh
index e73f29c..e06d177 100755
--- a/scripts/testing/run-test.sh
+++ b/scripts/testing/run-test.sh
@@ -22,6 +22,7 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
source "$SCRIPT_DIR/lib/logging.sh"
source "$SCRIPT_DIR/lib/vm-utils.sh"
source "$SCRIPT_DIR/lib/network-diagnostics.sh"
+source "$SCRIPT_DIR/lib/validation.sh"
# Parse arguments
KEEP_VM=false
@@ -63,6 +64,7 @@ TIMESTAMP=$(date +'%Y%m%d-%H%M%S')
VM_NAME="archsetup-base"
TEST_RESULTS_DIR="$PROJECT_ROOT/test-results/$TIMESTAMP"
ROOT_PASSWORD="archsetup"
+ARCHZFS_INBOX="$HOME/code/archzfs/inbox"
# Initialize logging
mkdir -p "$TEST_RESULTS_DIR"
@@ -155,6 +157,9 @@ if ! run_network_diagnostics "$VM_IP"; then
fatal "Network diagnostics failed - aborting test"
fi
+# Capture pre-install state for comparison
+capture_pre_install_state "$TEST_RESULTS_DIR"
+
# Transfer files to VM (simulating git clone)
section "Simulating Git Clone"
@@ -271,64 +276,25 @@ sshpass -p "$ROOT_PASSWORD" scp -o StrictHostKeyChecking=no -o UserKnownHostsFil
"root@$VM_IP:/root/.local/src/archsetup-*.txt" "$TEST_RESULTS_DIR/" 2>> "$LOGFILE" || \
warn "Could not copy package lists"
-# Run validation
-section "Validating Installation"
+# Capture post-install state
+capture_post_install_state "$TEST_RESULTS_DIR"
-VALIDATION_PASSED=true
+# Run comprehensive validation
+# This uses the validation.sh library for all checks
+run_all_validations
+validate_all_services
-# Check if user was created
-step "Checking if user 'cjennings' was created"
-if sshpass -p "$ROOT_PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
- "root@$VM_IP" "id cjennings" &>> "$LOGFILE"; then
- success "User cjennings exists"
-else
- error "User cjennings not found"
- VALIDATION_PASSED=false
-fi
+# Analyze log differences (pre vs post install)
+analyze_log_diff "$TEST_RESULTS_DIR"
-# Check if dotfiles were stowed
-step "Checking if dotfiles are stowed"
-if sshpass -p "$ROOT_PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
- "root@$VM_IP" "test -L /home/cjennings/.profile" &>> "$LOGFILE"; then
- success "Dotfiles appear to be stowed"
-else
- warn "Dotfiles may not be properly stowed"
- VALIDATION_PASSED=false
-fi
+# Generate issue attribution report
+# If base install issues found and archzfs inbox exists, create issue file
+generate_issue_report "$TEST_RESULTS_DIR" "$ARCHZFS_INBOX"
-# Check if dotfile symlinks are accessible by user (not just root)
-# This catches the bug where stow creates symlinks pointing to /root/archsetup or /tmp
-# Use sudo -u to avoid starting a full login shell which might hang
-step "Checking if dotfiles are readable by user cjennings"
-DOTFILE_CHECK=$(sshpass -p "$ROOT_PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
- "root@$VM_IP" "sudo -u cjennings cat /home/cjennings/.zshrc > /dev/null 2>&1 && echo OK || echo FAIL" 2>/dev/null)
-if [ "$DOTFILE_CHECK" = "OK" ]; then
- success "Dotfiles are readable by user cjennings"
+# Set validation result based on failure count
+if [ $VALIDATION_FAILED -eq 0 ]; then
+ VALIDATION_PASSED=true
else
- error "Dotfiles are NOT readable by user cjennings (symlinks may point to inaccessible location)"
- # Show where the symlink points for debugging
- sshpass -p "$ROOT_PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
- "root@$VM_IP" "ls -la /home/cjennings/.zshrc" >> "$LOGFILE" 2>&1
- VALIDATION_PASSED=false
-fi
-
-# Check if yay is installed
-step "Checking if yay (AUR helper) is installed"
-if sshpass -p "$ROOT_PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
- "root@$VM_IP" "/usr/bin/which yay" &>> "$LOGFILE"; then
- success "yay is installed"
-else
- error "yay not found"
- VALIDATION_PASSED=false
-fi
-
-# Check if DWM was built
-step "Checking if DWM is installed"
-if sshpass -p "$ROOT_PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
- "root@$VM_IP" "test -f /usr/local/bin/dwm" &>> "$LOGFILE"; then
- success "DWM is installed"
-else
- error "DWM not found"
VALIDATION_PASSED=false
fi
@@ -354,10 +320,24 @@ Results:
ArchSetup Exit Code: $ARCHSETUP_EXIT_CODE
Validation: $(if $VALIDATION_PASSED; then echo "PASSED"; else echo "FAILED"; fi)
+Validation Summary:
+ Passed: $VALIDATION_PASSED
+ Failed: $VALIDATION_FAILED
+ Warnings: $VALIDATION_WARNINGS
+
+Issue Attribution:
+ ArchSetup Issues: ${#ARCHSETUP_ISSUES[@]}
+ Base Install Issues: ${#BASE_INSTALL_ISSUES[@]}
+ Unknown Issues: ${#UNKNOWN_ISSUES[@]}
+
Artifacts:
Log file: $LOGFILE
Report: $REPORT_FILE
Results: $TEST_RESULTS_DIR/
+ Issue Report: $TEST_RESULTS_DIR/issue-report.txt
+ Pre-install logs: $TEST_RESULTS_DIR/pre-install/
+ Post-install logs: $TEST_RESULTS_DIR/post-install/
+ Analysis: $TEST_RESULTS_DIR/analysis/
EOFREPORT