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
No related branches found
No related tags found
No related merge requests found
......@@ -3,35 +3,45 @@
was ich so sehe ...
✅ 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
⬜ Dokumentation
⬜ Code aufräumen
## Tests schreiben
✅ Test auf gesetzte Metadaten
⬜ für alle Checks einen Test schreiben
⬜ ApacheProcesses
✅ Cert
✅ Diskfree
✅ Cert --> Hostname bei Wildcard-Zertifikat wird nicht erkannt
✅ Diskfree --> preg_replace hat den Integer Wert noch geholt
✅ 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
✅ HttpContent
✅ Loadmeter
MysqlConnect
PdoConnect
MysqlConnect -> mysqli->real_connect() Fatal error: Uncaught mysqli_sql_exception: No such file or directory
PdoConnect
⬜ Phpmodules
⬜ Ping
⬜ PortTcp
⬜ Simple
⬜ SqliteConnect
⬜ parent Option testen
⬜ group testen
## Done
✅ PHP compiliert zum Binary
✅ Binary startet in einem fremden Verzichnis
✅ Binary startet auf einen Nicht-PHP-System
---
......
<?php
$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);
$myarchitecture="x86_64";
......
......@@ -5,6 +5,9 @@ require_once __DIR__.'/../inc_functions.php';
require_once __DIR__.'/../inc_vars.php';
$AMCLI??=__DIR__.'/../src/amcli.php';
$AMCLI=__DIR__.'/../built_packages/amcli';
_chdir(__DIR__);
echo "\n\nSTART TESTS\n\n";
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