Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ibizaman committed Dec 4, 2024
1 parent 3161f9b commit 8955dc6
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/networking-hosts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,24 @@
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) =~ localhost$ ]]; then
cat $file
echo "'$(grep '127.0.0.1' $file | head -n1)'"
exit 1
fi
if [[ ! $(grep '127.0.0.1' $file | tail -n1) =~ "my.super.host$" ]]; then
if [[ ! $(grep '127.0.0.1' $file | tail -n1) =~ my.super.host$ ]]; then
cat $file
echo "'$(grep '127.0.0.1' $file | tail -n1)'"
exit 2
fi
if [[ ! $(grep '::1' $file) =~ "localhost$" ]]; then
exit 2
if [[ ! $(grep '::1' $file) =~ localhost$ ]]; then
cat $file
echo "'$(grep '::1' $file)'"
exit 3
fi
if [[ ! $(grep '10.0.0.1' $file) =~ "my.super.host my.other.host$"]]; then
if [[ ! $(grep '10.0.0.1' $file) =~ my.super.host\ my.other.host$ ]]; then
cat $file
echo "'$(grep '10.0.0.1' $file)'"
exit 4
fi
'';
Expand Down

0 comments on commit 8955dc6

Please sign in to comment.