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:
parent
8955dc6133
commit
66a580c92b
1 changed files with 4 additions and 12 deletions
|
@ -11,24 +11,16 @@
|
||||||
|
|
||||||
file=${config.out}/etc/hosts
|
file=${config.out}/etc/hosts
|
||||||
|
|
||||||
if [[ ! $(grep '127.0.0.1' $file | head -n1) =~ localhost$ ]]; then
|
if ! grep '127.0.0.1' $file | head -n1 | grep localhost$; then
|
||||||
cat $file
|
|
||||||
echo "'$(grep '127.0.0.1' $file | head -n1)'"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [[ ! $(grep '127.0.0.1' $file | tail -n1) =~ my.super.host$ ]]; then
|
if ! grep '127.0.0.1' $file | tail -n1 | grep my.super.host$; then
|
||||||
cat $file
|
|
||||||
echo "'$(grep '127.0.0.1' $file | tail -n1)'"
|
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
if [[ ! $(grep '::1' $file) =~ localhost$ ]]; then
|
if ! grep '::1' $file | grep localhost$; then
|
||||||
cat $file
|
|
||||||
echo "'$(grep '::1' $file)'"
|
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
if [[ ! $(grep '10.0.0.1' $file) =~ my.super.host\ my.other.host$ ]]; then
|
if ! grep '10.0.0.1' $file | grep my.super.host\ my.other.host$; then
|
||||||
cat $file
|
|
||||||
echo "'$(grep '10.0.0.1' $file)'"
|
|
||||||
exit 4
|
exit 4
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue