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
|
||||
|
||||
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
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue