diff options
| author | Craig Jennings <c@cjennings.net> | 2026-01-10 00:54:17 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-01-10 01:43:58 -0600 |
| commit | 41014590cc54ec490505a3851fa59ef8c5d6aebe (patch) | |
| tree | 94e1734227a8bb2f99d6dc6374a30f4eaa93b065 /scripts/testing | |
| parent | 173d3a70e32e3ce1c83cf98346ab9d007782c5b6 (diff) | |
fix(archsetup): copy archsetup to user directory before stow
Previously, stow created dotfile symlinks pointing to wherever archsetup
was run from (e.g., /root/archsetup or /tmp). If run from a location
inaccessible to the user, zsh would fail to read its config on first
login and prompt for new user setup.
The fix copies archsetup to ~/code/archsetup before running stow, ensuring
symlinks always point to a user-accessible location.
Also adds a test to verify dotfiles are readable by the user (not just root).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'scripts/testing')
| -rwxr-xr-x | scripts/testing/run-test.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/testing/run-test.sh b/scripts/testing/run-test.sh index 4bcb55b..e73f29c 100755 --- a/scripts/testing/run-test.sh +++ b/scripts/testing/run-test.sh @@ -296,6 +296,22 @@ else VALIDATION_PASSED=false fi +# 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" +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 \ |
