improve verify flake module

This commit is contained in:
Ingolf Wagner 2024-09-22 08:19:07 +09:00
parent 9ae95ddb11
commit 61eaadba3d
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
2 changed files with 6 additions and 6 deletions

View file

@ -173,7 +173,6 @@
++ [
./machines/${name}/configuration.nix
nix-topology.nixosModules.default
self.nixosModules.verify
];
};
@ -415,6 +414,7 @@
name = "cherry";
host = "cherry.bear";
modules = [
self.nixosModules.verify
zerotierModules
nixos-hardware.nixosModules.framework-13th-gen-intel
retiolum.nixosModules.retiolum
@ -436,6 +436,7 @@
name = "chungus";
host = "chungus.bear";
modules = [
self.nixosModules.verify
zerotierModules
zerotierControllerModule
homeManagerModules
@ -457,6 +458,7 @@
host = "orbi.bear";
#host = "95.216.66.212";
modules = [
self.nixosModules.verify
homeManagerModules
stylixModules
zerotierModules

View file

@ -53,21 +53,19 @@ with types;
if ${curl} -s -o /dev/null -w "%{http_code}" ${url} | ${grep} -q "${toString responseCode}"; then
if ${curl} -s ${url} | ${grep} -q "${expectedContent}"; then
echo -n ""
#echo " [ OK ] Die Seite hat Statuscode ${toString responseCode} und enthält den String '${expectedContent}'."
else
echo " [Fail] Der Statuscode ist 200, aber die Seite enthält den String '${expectedContent}' nicht."
echo " [Fail] ${url} did return ${toString responseCode}, but did not contain the string '${expectedContent}'."
fi
else
echo " [Fail] Die Seite hat keinen Statuscode ${toString responseCode}."
echo " [Fail] ${url} did not return ${toString responseCode}."
fi
'';
scriptWithoutExpectedContent = url: responseCode: ''
if ${curl} -s -o /dev/null -w "%{http_code}" ${url} | ${grep} -q "${toString responseCode}"; then
echo -n ""
#echo " [ OK ] Die Seite hat Statuscode ${toString responseCode}."
else
echo " [Fail] Die Seite hat keinen Statuscode ${toString responseCode}."
echo " [Fail] ${url} did not return ${toString responseCode}."
fi
'';
script =