diff --git a/tests/networking-hosts.nix b/tests/networking-hosts.nix index fc4f2e4d6..e16813f22 100644 --- a/tests/networking-hosts.nix +++ b/tests/networking-hosts.nix @@ -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 '';