Skip to content
Snippets Groups Projects
Commit 17f9a729 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update tests and included php modules in binary

parent feffd957
Branches
Tags
No related merge requests found
...@@ -3,35 +3,45 @@ ...@@ -3,35 +3,45 @@
was ich so sehe ... was ich so sehe ...
✅ Slack-Notifikation: statt Parsing-mechanismus eines Strings --> JSON in der INI schreiben ✅ Slack-Notifikation: statt Parsing-mechanismus eines Strings --> JSON in der INI schreiben
`--ini=<FILE>` bei relativem Pfad ist relativ zum Binary --> nicht ins eigene Verzeichnis wechseln `--ini=<FILE>` bei relativem Pfad ist relativ zum Binary --> nicht ins eigene Verzeichnis wechseln
⬜ Dokumentation ⬜ Dokumentation
⬜ Code aufräumen ⬜ Code aufräumen
## Tests schreiben ## Tests schreiben
✅ Test auf gesetzte Metadaten ✅ Test auf gesetzte Metadaten
⬜ für alle Checks einen Test schreiben ⬜ für alle Checks einen Test schreiben
⬜ ApacheProcesses ⬜ ApacheProcesses
✅ Cert ✅ Cert --> Hostname bei Wildcard-Zertifikat wird nicht erkannt
✅ Diskfree ✅ Diskfree --> preg_replace hat den Integer Wert noch geholt
✅ Exec ✅ Exec
File --> "exists": false meldet bei Test einer nicht existierenden Datei fälschlicherweise einen Fehler File --> "exists": false meldet bei Test einer nicht existierenden Datei fälschlicherweise einen Fehler
✅ Hello ✅ Hello
✅ HttpContent ✅ HttpContent
✅ Loadmeter ✅ Loadmeter
MysqlConnect MysqlConnect -> mysqli->real_connect() Fatal error: Uncaught mysqli_sql_exception: No such file or directory
PdoConnect PdoConnect
⬜ Phpmodules ⬜ Phpmodules
⬜ Ping ⬜ Ping
⬜ PortTcp ⬜ PortTcp
⬜ Simple ⬜ Simple
⬜ SqliteConnect ⬜ SqliteConnect
⬜ parent Option testen
⬜ group testen
## Done ## Done
✅ PHP compiliert zum Binary ✅ PHP compiliert zum Binary
✅ Binary startet in einem fremden Verzichnis ✅ Binary startet in einem fremden Verzichnis
✅ Binary startet auf einen Nicht-PHP-System ✅ Binary startet auf einen Nicht-PHP-System
--- ---
......
<?php <?php
$php_version="8.3"; $php_version="8.3";
$php_libs="zlib";
// extensions - see https://static-php.dev/en/guide/extensions.html
$php_libs="mysqli,openssl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,zlib";
$myos=strtolower(PHP_OS); $myos=strtolower(PHP_OS);
$myarchitecture="x86_64"; $myarchitecture="x86_64";
......
...@@ -5,6 +5,9 @@ require_once __DIR__.'/../inc_functions.php'; ...@@ -5,6 +5,9 @@ require_once __DIR__.'/../inc_functions.php';
require_once __DIR__.'/../inc_vars.php'; require_once __DIR__.'/../inc_vars.php';
$AMCLI??=__DIR__.'/../src/amcli.php'; $AMCLI??=__DIR__.'/../src/amcli.php';
$AMCLI=__DIR__.'/../built_packages/amcli';
_chdir(__DIR__);
echo "\n\nSTART TESTS\n\n"; echo "\n\nSTART TESTS\n\n";
foreach(glob("*.php") as $sFile){ foreach(glob("*.php") as $sFile){
......
File moved
#!/usr/bin/env php
<?php
echo "
WHAT: Run check mysqlconnect
";
_exec("$AMCLI --ini='".__DIR__."/configs/mysqlconnect.ini'");
#!/usr/bin/env php
<?php
echo "
WHAT: Run check pdoconnect
";
_exec("$AMCLI --ini='".__DIR__."/configs/pdoconnect.ini'");
; =======================================================================
;
; APPMONITOR CLI CLIENT
;
; for the checks see its parameters
; <https://os-docs.iml.unibe.ch/appmonitor/PHP_client/Plugins/Checks/index.html>
;
; =======================================================================
; -----------------------------------------------------------------------
; CHECKS
; -----------------------------------------------------------------------
["Mysqlconnect"]
description="Test Mysql database connection"
function="Mysqlconnect"
params='{
"server": "127.0.0.1",
"user": "root",
"password": "12345678",
"db": "ahcrawler",
"port": "13306"
}'
; -----------------------------------------------------------------------
; =======================================================================
;
; APPMONITOR CLI CLIENT
;
; for the checks see its parameters
; <https://os-docs.iml.unibe.ch/appmonitor/PHP_client/Plugins/Checks/index.html>
;
; =======================================================================
; -----------------------------------------------------------------------
; CHECKS
; -----------------------------------------------------------------------
["PDO connect mysql"]
description="PDO - Test Mysql database connection"
function="Pdoconnect"
params='{
"connect": "mysql:host=127.0.0.1;port=13306;dbname=ahcrawler;",
"user": "root",
"password": "12345678"
}'
; -----------------------------------------------------------------------
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment