1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

refactor tests

This commit is contained in:
ibizaman 2024-12-05 16:23:33 +01:00
parent 8955dc6133
commit 66a580c92b

View file

@ -11,24 +11,16 @@
file=${config.out}/etc/hosts
if [[ ! $(grep '127.0.0.1' $file | head -n1) =~ localhost$ ]]; then
cat $file
echo "'$(grep '127.0.0.1' $file | head -n1)'"
if ! grep '127.0.0.1' $file | head -n1 | grep localhost$; then
exit 1
fi
if [[ ! $(grep '127.0.0.1' $file | tail -n1) =~ my.super.host$ ]]; then
cat $file
echo "'$(grep '127.0.0.1' $file | tail -n1)'"
if ! grep '127.0.0.1' $file | tail -n1 | grep my.super.host$; then
exit 2
fi
if [[ ! $(grep '::1' $file) =~ localhost$ ]]; then
cat $file
echo "'$(grep '::1' $file)'"
if ! grep '::1' $file | grep localhost$; then
exit 3
fi
if [[ ! $(grep '10.0.0.1' $file) =~ my.super.host\ my.other.host$ ]]; then
cat $file
echo "'$(grep '10.0.0.1' $file)'"
if ! grep '10.0.0.1' $file | grep my.super.host\ my.other.host$; then
exit 4
fi
'';