From 907cf05a2f313fb7077c5a0f0a4a0b1f6e5d9693 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Tue, 4 Mar 2025 10:31:09 +0100
Subject: [PATCH] simple check added/ tested

---
 TODO.md                  |  2 +-
 tests/200_simple.php     |  7 +++++++
 tests/configs/simple.ini | 31 +++++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 tests/200_simple.php
 create mode 100644 tests/configs/simple.ini

diff --git a/TODO.md b/TODO.md
index cce8576..a5d280f 100644
--- a/TODO.md
+++ b/TODO.md
@@ -29,7 +29,7 @@ was ich so sehe ...
     ✅ Phpmodules -> funcktioniert formal, aber bei Nicht-PHP-Apps nicht relevant; getestet werden die im Binary eincomoilierten Module
     ✅ Ping
     ✅ PortTcp -> sockets Modul im Binary hinzugefügt.
-    ⬜ Simple
+    ✅ Simple
     ⬜ SqliteConnect
 
 ⬜ parent Option testen
diff --git a/tests/200_simple.php b/tests/200_simple.php
new file mode 100644
index 0000000..ceeb8c8
--- /dev/null
+++ b/tests/200_simple.php
@@ -0,0 +1,7 @@
+#!/usr/bin/env php
+<?php
+
+echo "
+WHAT: Run check simple
+";
+_exec("$AMCLI --ini='".__DIR__."/configs/simple.ini'");
diff --git a/tests/configs/simple.ini b/tests/configs/simple.ini
new file mode 100644
index 0000000..e135f48
--- /dev/null
+++ b/tests/configs/simple.ini
@@ -0,0 +1,31 @@
+; =======================================================================
+;
+; APPMONITOR CLI CLIENT
+;
+; for the checks see its parameters
+; <https://os-docs.iml.unibe.ch/appmonitor/PHP_client/Plugins/Checks/index.html>
+;
+; =======================================================================
+
+
+; -----------------------------------------------------------------------
+; CHECKS
+; -----------------------------------------------------------------------
+
+["Simple test 1"]
+description="Simple OK"
+function="Simple"
+params='{
+    "result": 0,
+    "value": "Everything is fine"
+}'
+
+["Simple test 2"]
+description="Simple Unknown"
+function="Simple"
+params='{
+    "result": 1,
+    "value": "Unknown state"
+}'
+
+; -----------------------------------------------------------------------
-- 
GitLab