diff options
| author | Craig Jennings <c@cjennings.net> | 2026-01-20 18:34:04 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-01-20 18:34:04 -0600 |
| commit | 7ed87b82fb556395d5e905c0162c1d6b2cfd2c63 (patch) | |
| tree | f16e4deb22daf70c42da21b82c8d80aae23ce639 /scripts/sanity-test.sh | |
| parent | a122aac2622556e7fe36396f950bb2b4459d731a (diff) | |
| download | archangel-7ed87b82fb556395d5e905c0162c1d6b2cfd2c63.tar.gz archangel-7ed87b82fb556395d5e905c0162c1d6b2cfd2c63.zip | |
Fix mDNS, hostname, and build safety
- Add safe_cleanup_work_dir() to prevent /dev corruption on interrupted builds
- Fix shadow file: use sed to modify root entry instead of replacing file
- Add /etc/hosts and /etc/nsswitch.conf for proper hostname/mDNS resolution
- Add inetutils package for hostname command
- Add sanity tests for password, avahi, mdns, and hostname
Diffstat (limited to 'scripts/sanity-test.sh')
| -rwxr-xr-x | scripts/sanity-test.sh | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/scripts/sanity-test.sh b/scripts/sanity-test.sh index 0b338a3..eeb4d29 100755 --- a/scripts/sanity-test.sh +++ b/scripts/sanity-test.sh @@ -260,12 +260,21 @@ run_sanity_tests() { # Test 6: SSH is working (implicit - we're connected) pass "SSH connectivity" + # Test 6b: Root password is set (not empty in shadow file) + run_test "Root password is set" \ + "grep '^root:' /etc/shadow | cut -d: -f2 | grep -q '.' && echo 'password set'" \ + "password set" + # Test 7: Network manager available run_test "NetworkManager available" \ "systemctl is-enabled NetworkManager 2>/dev/null || echo 'available'" \ "" # Test 8: Avahi mDNS for network discovery + run_test "Avahi package installed" \ + "command -v avahi-daemon && echo 'found'" \ + "found" + run_test "Avahi daemon enabled" \ "systemctl is-enabled avahi-daemon" \ "enabled" @@ -274,7 +283,16 @@ run_sanity_tests() { "systemctl is-active avahi-daemon" \ "active" - # Test 9: Kernel version (LTS) + run_test "nss-mdns configured" \ + "grep -q 'mdns' /etc/nsswitch.conf && echo 'configured'" \ + "configured" + + # Test 9: Hostname set to archzfs + run_test "Hostname is archzfs" \ + "cat /etc/hostname" \ + "archzfs" + + # Test 10: Kernel version (LTS) run_test "Running LTS kernel" \ "uname -r" \ "lts" |
