-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1167 from cgwalters/reallyclean
store: Really remove empty /etc/resolv.conf and /etc/hostname
- Loading branch information
Showing
2 changed files
with
40 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use std assert | ||
use tap.nu | ||
|
||
tap begin "verify there's not an empty /etc/resolv.conf in the image" | ||
|
||
let st = bootc status --json | from json | ||
|
||
let booted_ostree = $st.status.booted.ostree.checksum; | ||
|
||
# ostree ls should probably have --json and a clean way to not error on ENOENT | ||
let resolvconf = ostree ls $booted_ostree /usr/etc | split row (char newline) | find resolv.conf | ||
if ($resolvconf | length) > 0 { | ||
let parts = $resolvconf | first | split row -r '\s+' | ||
let ty = $parts | first | split chars | first | ||
# If resolv.conf exists in the image, currently require it in our | ||
# test suite to be a symlink (which is hopefully to the systemd/stub-resolv.conf) | ||
assert equal $ty 'l' | ||
print "resolv.conf is a symlink" | ||
} else { | ||
print "No resolv.conf found in commit" | ||
} | ||
|
||
tap ok |