diff --git a/tests/00_start.php b/tests/00_start.php
new file mode 100755
index 0000000000000000000000000000000000000000..bb0df25c5755da3d25aa2cff3a3baf9bd207f541
--- /dev/null
+++ b/tests/00_start.php
@@ -0,0 +1,20 @@
+#!/bin/env php
+<?php
+
+require_once __DIR__.'/../inc_functions.php';
+require_once __DIR__.'/../inc_vars.php';
+
+$AMCLI??=__DIR__.'/../src/amcli.php';
+
+echo "\n\nSTART TESTS\n\n";
+foreach(glob("*.php") as $sFile){
+    if($sFile==basename(__FILE__)){
+        // SKIP
+    } else {
+        _h1("$sFile");
+        include $sFile;    
+    }
+
+}
+
+_h1("DONE");
diff --git a/tests/010_is_executable.php b/tests/010_is_executable.php
new file mode 100644
index 0000000000000000000000000000000000000000..ad0b83b3579b3f60b35c487869052635919ba701
--- /dev/null
+++ b/tests/010_is_executable.php
@@ -0,0 +1,7 @@
+#!/usr/bin/env php
+<?php
+
+echo "
+WHAT: Check if $AMCLI is executable
+";
+_exec("$AMCLI -V");
diff --git a/tests/020_is_executable_in_tmp.php b/tests/020_is_executable_in_tmp.php
new file mode 100644
index 0000000000000000000000000000000000000000..a8f55723a8e3b6f274d0ff2e3a508cadef7faa49
--- /dev/null
+++ b/tests/020_is_executable_in_tmp.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+<?php
+
+echo "
+WHAT: Check if $AMCLI is executable in another place, eg.tmp
+";
+
+if(strstr($AMCLI, ".php")){
+    echo "SKIP: not for php script - it is for the binary only.\n";
+    return true;
+}
+
+$tmpfile="/tmp/".basename($AMCLI);
+file_put_contents($tmpfile, file_get_contents($AMCLI));
+chmod($tmpfile, 0700);
+_exec("$tmpfile -V");
+unlink($tmpfile);
diff --git a/tests/030_has_help.php b/tests/030_has_help.php
new file mode 100644
index 0000000000000000000000000000000000000000..4652a7ad616284ffdfd70b5b81d04e3927c56d3e
--- /dev/null
+++ b/tests/030_has_help.php
@@ -0,0 +1,7 @@
+#!/usr/bin/env php
+<?php
+
+echo "
+WHAT: Check if $AMCLI shows a help page
+";
+_exec("$AMCLI -h");
diff --git a/tests/110_set_metadata.php b/tests/110_set_metadata.php
new file mode 100644
index 0000000000000000000000000000000000000000..faad586998c14e964fac8b263788846bb7f3be0b
--- /dev/null
+++ b/tests/110_set_metadata.php
@@ -0,0 +1,64 @@
+#!/usr/bin/env php
+<?php
+
+echo "
+WHAT: Set application metadata
+";
+
+$sInifile=__DIR__."/configs/metadata.ini";
+
+// --------------------------------------------------------------------
+// FUNCTION
+// --------------------------------------------------------------------
+
+function compare_strings($sKey, $sIniValue, $aResponseValue=null){
+    echo "Values for '$sKey':\n  INI     : $sIniValue\n  Response: $aResponseValue\n            ";
+    if ($sIniValue!=$aResponseValue){
+        _abort("Values differ");
+    }
+    _ok(); echo "\n";
+}
+
+// --------------------------------------------------------------------
+// MAIN
+// --------------------------------------------------------------------
+
+// basic check ... the ini file is processed?
+_exec("$AMCLI --ini='$sInifile'");
+
+// --------------------------------------------------------------------
+
+// yes. Now let's compare ini values and the response
+exec("$AMCLI --ini='$sInifile'", $aOut, $rc);
+
+$aIni=parse_ini_file($sInifile, 1);
+$aResponse=json_decode($aOut[0], 1);
+
+// print_r($aIni);
+// print_r($aResponse);
+
+// --------------------------------------------------------------------
+
+echo "\n";
+compare_strings("host", $aIni["meta"]["host"], $aResponse["meta"]["host"]);
+compare_strings("website", $aIni["meta"]["website"], $aResponse["meta"]["website"]);
+compare_strings("ttl", $aIni["meta"]["ttl"], $aResponse["meta"]["ttl"]);
+
+foreach($aIni["notifications"]["email"]??[] as $sEmail){
+    echo "Check Email '$sEmail'\n";
+    if(array_search($sEmail, $aResponse["meta"]["notifications"]["email"])===false){
+        _abort("Email not found in response");
+    }
+    _ok(); echo "\n";
+}
+
+foreach($aIni["notifications"]["slack"]??[] as $sValue){
+    $aArray = json_decode($sValue, 1);
+    $sChannel = array_keys($aArray)[0];
+    $sWebhook = array_values($aArray)[0];
+
+    echo "Check Slack '$sChannel'\n";
+    compare_strings("Check Slack '$sChannel'", $sWebhook, $aResponse["meta"]["notifications"]['slack'][$sChannel]??'');
+}
+
+// --------------------------------------------------------------------
diff --git a/tests/200_cert.php b/tests/200_cert.php
new file mode 100644
index 0000000000000000000000000000000000000000..f7f34185cf33254c1e66f78b37511df85e7f6739
--- /dev/null
+++ b/tests/200_cert.php
@@ -0,0 +1,7 @@
+#!/usr/bin/env php
+<?php
+
+echo "
+WHAT: Run check cert
+";
+_exec("$AMCLI --ini='".__DIR__."/configs/cert.ini'");
diff --git a/tests/200_diskfree.php b/tests/200_diskfree.php
new file mode 100644
index 0000000000000000000000000000000000000000..f7f34185cf33254c1e66f78b37511df85e7f6739
--- /dev/null
+++ b/tests/200_diskfree.php
@@ -0,0 +1,7 @@
+#!/usr/bin/env php
+<?php
+
+echo "
+WHAT: Run check cert
+";
+_exec("$AMCLI --ini='".__DIR__."/configs/cert.ini'");
diff --git a/tests/200_exec.php b/tests/200_exec.php
new file mode 100644
index 0000000000000000000000000000000000000000..499bcd9a3951db2f01cfbb3bf2cb1580ecd1befe
--- /dev/null
+++ b/tests/200_exec.php
@@ -0,0 +1,7 @@
+#!/usr/bin/env php
+<?php
+
+echo "
+WHAT: Run check Exec
+";
+_exec("$AMCLI --ini='".__DIR__."/configs/exec.ini'");
diff --git a/tests/200_file.php b/tests/200_file.php
new file mode 100644
index 0000000000000000000000000000000000000000..5664c8d129b3fd72015204b64da81a6c051c587e
--- /dev/null
+++ b/tests/200_file.php
@@ -0,0 +1,7 @@
+#!/usr/bin/env php
+<?php
+
+echo "
+WHAT: Run check File
+";
+_exec("$AMCLI --ini='".__DIR__."/configs/file.ini'");
diff --git a/tests/200_simple.php b/tests/200_simple.php
new file mode 100644
index 0000000000000000000000000000000000000000..e88d4eb6a65c349923805f858862bbe7f2cc5b1a
--- /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/cert.ini b/tests/configs/cert.ini
new file mode 100644
index 0000000000000000000000000000000000000000..718644897bdc189333f0c76ab972ae2c0c019920
--- /dev/null
+++ b/tests/configs/cert.ini
@@ -0,0 +1,22 @@
+; =======================================================================
+;
+; APPMONITOR CLI CLIENT
+;
+; for the checks see its parameters
+; <https://os-docs.iml.unibe.ch/appmonitor/PHP_client/Plugins/Checks/index.html>
+;
+; =======================================================================
+
+
+; -----------------------------------------------------------------------
+; CHECKS
+; -----------------------------------------------------------------------
+
+["Cert plugin"]
+description="SSL certificate of www.example.com"
+function="Cert"
+params='{
+    "url": "https://www.example.com"
+}'
+
+; -----------------------------------------------------------------------
diff --git a/tests/configs/diskfree.ini b/tests/configs/diskfree.ini
new file mode 100644
index 0000000000000000000000000000000000000000..92a0c1fbc446b672488f821da22631e585f3231d
--- /dev/null
+++ b/tests/configs/diskfree.ini
@@ -0,0 +1,24 @@
+; =======================================================================
+;
+; APPMONITOR CLI CLIENT
+;
+; for the checks see its parameters
+; <https://os-docs.iml.unibe.ch/appmonitor/PHP_client/Plugins/Checks/index.html>
+;
+; =======================================================================
+
+
+; -----------------------------------------------------------------------
+; CHECKS
+; -----------------------------------------------------------------------
+
+["Free disk space /tmp"]
+description="Check free diskspace in /tmp"
+function="Diskfree"
+params='{
+    "directory": "/tmp",
+    "warning": "1GB",
+    "critical": "500MB"
+}'
+
+; -----------------------------------------------------------------------
diff --git a/tests/configs/exec.ini b/tests/configs/exec.ini
new file mode 100644
index 0000000000000000000000000000000000000000..af221232b761fbdd01fe5e05ee877c9377972c7d
--- /dev/null
+++ b/tests/configs/exec.ini
@@ -0,0 +1,22 @@
+; =======================================================================
+;
+; APPMONITOR CLI CLIENT
+;
+; for the checks see its parameters
+; <https://os-docs.iml.unibe.ch/appmonitor/PHP_client/Plugins/Checks/index.html>
+;
+; =======================================================================
+
+
+; -----------------------------------------------------------------------
+; CHECKS
+; -----------------------------------------------------------------------
+
+["Exec uptime"]
+description="Start uptime command"
+function="Exec"
+params='{
+    "command": "uptime"
+}'
+
+; -----------------------------------------------------------------------
diff --git a/tests/configs/file.ini b/tests/configs/file.ini
new file mode 100644
index 0000000000000000000000000000000000000000..542bc21dd0cf47c359cf96aea74871ccbe82f1a0
--- /dev/null
+++ b/tests/configs/file.ini
@@ -0,0 +1,35 @@
+; =======================================================================
+;
+; APPMONITOR CLI CLIENT
+;
+; for the checks see its parameters
+; <https://os-docs.iml.unibe.ch/appmonitor/PHP_client/Plugins/Checks/index.html>
+;
+; =======================================================================
+
+
+; -----------------------------------------------------------------------
+; CHECKS
+; -----------------------------------------------------------------------
+
+["Check dir /tmp"]
+description="Check existing dir"
+function="File"
+params='{
+    "filename": "/tmp",
+    "exists": true,
+    "flag": "dir",
+    "readable": true,
+    "writable": true
+}'
+
+["No maintenance"]
+description="Check non existing maintenance flag file"
+function="File"
+params='{
+    "filename": "/some/where/maintenance.txt",
+    "exists": false,
+    "flag": "file"
+}'
+
+; -----------------------------------------------------------------------
diff --git a/tests/configs/hello.ini b/tests/configs/hello.ini
new file mode 100644
index 0000000000000000000000000000000000000000..17f97bc7bc00b11d9093f1a0a9d92f5223e5e649
--- /dev/null
+++ b/tests/configs/hello.ini
@@ -0,0 +1,22 @@
+; =======================================================================
+;
+; APPMONITOR CLI CLIENT
+;
+; for the checks see its parameters
+; <https://os-docs.iml.unibe.ch/appmonitor/PHP_client/Plugins/Checks/index.html>
+;
+; =======================================================================
+
+
+; -----------------------------------------------------------------------
+; CHECKS
+; -----------------------------------------------------------------------
+
+["hello plugin"]
+description="I sust wann say hello"
+function="hello"
+params='{
+"message": "Here I am"
+}'
+
+; -----------------------------------------------------------------------
diff --git a/tests/configs/metadata.ini b/tests/configs/metadata.ini
new file mode 100644
index 0000000000000000000000000000000000000000..09097225a71d98ed07ae1b4d7cf449fa6d8e25eb
--- /dev/null
+++ b/tests/configs/metadata.ini
@@ -0,0 +1,45 @@
+; =======================================================================
+;
+; APPMONITOR CLI CLIENT
+;
+; to understand the entries of metadata see JSON in 
+; <https://os-docs.iml.unibe.ch/appmonitor/Client/Description_of_response.html>
+;
+; for the checks see its parameters
+; <https://os-docs.iml.unibe.ch/appmonitor/PHP_client/Plugins/Checks/index.html>
+;
+; =======================================================================
+
+
+; -----------------------------------------------------------------------
+; METADATA
+; -----------------------------------------------------------------------
+
+[meta]
+host = "www.example.com"
+website = "Company website"
+ttl = 300
+tags[]="monitoring"
+
+
+[notifications]
+email[]="support@example.com"
+email[]="webmaster@example.com"
+
+; for slack use the following format
+; <channelname> + comma + <webhook url>
+slack[]='{ "#support-channel": "https://hooks.slack.com/services/XXXXXX/YYYYYY/ZZZZZ" }'
+
+
+; -----------------------------------------------------------------------
+; CHECKS
+; -----------------------------------------------------------------------
+
+["hello plugin"]
+description="I sust wann say hello"
+function="hello"
+params='{
+"message": "Here I am"
+}'
+
+; -----------------------------------------------------------------------