X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-si%2Ftests%2Fclient.php;h=84c5d701a586e3159b259861cb5857f3cb50e721;hb=06fd60ccdfa1f960ece1310f9d74d6992261ffc0;hp=c97a879f9b8331f0e2352301e005e08fc26464ca;hpb=5993c371fd3cfc73eada2207230c0841cebd08d7;p=gosa.git
diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php
index c97a879f9..84c5d701a 100755
--- a/gosa-si/tests/client.php
+++ b/gosa-si/tests/client.php
@@ -4,6 +4,12 @@
require_once("../../gosa-core/include/class_socketClient.inc");
error_reporting(E_ALL);
+function microtime_float()
+{
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+}
+
$zahl= 1;
for($count = 1; $count <= $zahl; $count++)
@@ -11,11 +17,59 @@ for($count = 1; $count <= $zahl; $count++)
$sock = new Socket_Client("127.0.0.1","20081",TRUE,5);
$sock->setEncryptionKey("secret-gosa-password");
- #$sock = new Socket_Client("10.89.1.30","20081",TRUE,5);
+ #$sock = new Socket_Client("10.89.1.42","20081",TRUE,5);
#$sock->setEncryptionKey("secret-gosa-password");
+ $mac = "00:01:6C:9D:B9:FA"; # ws-muc-02
+
if($sock->connected()){
+ # Funktioniert noch nicht
+ #$data = "GOSA00:01:6C:9D:B9:FAacroread";
+
+ #$data = "gosa_opsi_getLicenseInformationForProductGOSA00:01:6C:9D:B9:FApython";
+ #$data = "gosa_opsi_getLicenseInformationForProductGOSA00:01:6C:9D:B9:FAfirefox";
+
+ #$data = "gosa_opsi_getLicensePools_listOfHashesGOSA00:01:6C:9D:B9:FA";
+
+ #$data = "gosa_opsi_getLicensePool_hashGOSA00:01:6C:9D:B9:FALicensePool";
+
+ #$data = "gosa_opsi_createLicensePoolGOSA00:01:6C:9D:B9:FAHaraldDas 134te Schaafacrobatwinzip";
+
+ #$data = "gosa_opsi_deleteLicensePoolGOSA00:01:6C:9D:B9:FASusi";
+
+ #$data = "GOSA00:01:6C:9D:B9:FAGonicus GmbHI'm a note!1LicensePoolabcdefghiandisLizenzVOLUMEkrakenarme.intranet.gonicus.de";
+
+ #$data = "gosa_opsi_assignSoftwareLicenseToHostGOSA00:01:6C:9D:B9:FASusilinux-cl-2.intranet.gonicus.de";
+
+ #$data = "gosa_opsi_unassignSoftwareLicenseFromHostGOSA00:01:6C:9D:B9:FASusilinux-cl-2.intranet.gonicus.de";
+
+ #$data = "gosa_opsi_unassignAllSoftwareLicensesFromHostGOSA00:01:6C:9D:B9:FAlinux-cl-2.intranet.gonicus.de";
+
+ #$data = "gosa_opsi_getSoftwareLicenseUsagesGOSA00:01:6C:9D:B9:FAkrakenarme.intranet.gonicus.de";
+ #$data = "gosa_opsi_getSoftwareLicenseUsagesGOSA00:01:6C:9D:B9:FALicensePool";
+ #$data = "gosa_opsi_getSoftwareLicenseUsagesGOSA00:01:6C:9D:B9:FA";
+ #$data = "gosa_opsi_getSoftwareLicenseUsagesForProductIdGOSA00:01:6C:9D:B9:FAfirefox";
+
+ #$data = "gosa_opsi_getSoftwareLicense_hashGOSA00:01:6C:9D:B9:FAl_2009-09-22_09:50:58_0";
+
+ #$data = "GOSA00:01:6C:9D:B9:FALicensePool";
+
+ #$data = "GOSA00:01:6C:9D:B9:FALicensePooll_2009-09-22_14:06:11";
+
+ #$data = "gosa_opsi_getReservedLicensesGOSA00:01:6C:9D:B9:FAlinux-cl-2.intranet.gonicus.de";
+
+ #$data = "gosa_opsi_boundHostToLicenseGOSA00:01:6C:9D:B9:FAandisLizenzkrakenarme.intranet.gonicus.de";
+ #$data = "gosa_opsi_unboundHostFromLicenseGOSA00:01:6C:9D:B9:FAandisLizenz";
+
+ #$data = "gosa_opsi_getAllSoftwareLicensesGOSA00:01:6C:9D:B9:FA";
+
+ $data = "gosa_opsi_get_full_product_host_informationGOSA00:01:6C:9D:B9:FAlinux-cl-2.intranet.gonicus.de";
+
+ ##############################
+ # periodical jobs
+ #$data = "job_trigger_action_rebootGOSA00:0c:29:4c:4b:0c00:0c:29:4c:4b:0c234506290000003_months";
+ #$data = "job_trigger_action_rebootGOSA00:0c:29:4c:4b:0c2009062613500000:0c:29:4c:4b:0cminutes5";
/* Prepare a hunge bunch of data to be send */
# jobdb add
#$data = " gosa_network_completition GOSAGOSAws-muc-2";
@@ -26,13 +80,13 @@ for($count = 1; $count <= $zahl; $count++)
#$data = " GOSA GOSA 3";
# smbhash
- #$data = " GOSAGOSAtester";
+ #$data = " GOSAGOSArettenbe";
# Reload ldap config
- #$data = " gosa_trigger_reload_ldap_config GOSA00:01:6c:9d:b9:fa";
+ #$data = " gosa_trigger_reload_ldap_config GOSA00:0C:29:4C:4B:0C";
# jobdb update
- #$data = " gosa_update_status_jobdb_entry GOSA GOSA 1 19700101000000";
+ #$data = " gosa_update_status_jobdb_entry GOSA GOSA 1 12_weeks";
#$data = " gosa_update_status_jobdb_entry GOSAGOSA 00:01:6c:9d:b9:fa processing update";
# jobdb query
@@ -55,26 +109,34 @@ for($count = 1; $count <= $zahl; $count++)
#$data = " GOSA GOSA";
# set gosa-si-client to 'activated'
- #$data = " job_set_activated_for_installation 10.89.1.31:20083 GOSA 00:01:6c:9d:b9:fa22220101000000";
+ #$data = " gosa_set_activated_for_installation 00:0C:29:4C:4B:0C GOSA 00:0C:29:4C:4B:0C22220101000000";
# trigger jobs at client
- #$data = " 10.89.1.31:20083 GOSA ";
- #$data = " 00:01:6c:9d:b9:fa 10.89.1.31:20081 ";
- #$data = " 00:01:6c:9d:b9:fa GOSA 19700101000000";
- #$data = " gosa_trigger_action_faireboot 00:01:6c:9d:b9:fa GOSA ";
- #$data = " gosa_trigger_action_reboot 00:01:6c:9d:b9:fa GOSA ";
- #$data = " 00:01:6c:9d:b9:fa GOSA ";
- #$data = " job_trigger_action_reinstall GOSA 00:01:6c:9d:b9:fa 00:01:6c:9d:b9:fa 19700101000000 ";
- #$data = " job_trigger_action_instant_update 00:01:6c:9d:b9:fa GOSA 19700101000000 ";
+ #$data = " gosa_trigger_goto_settings_reload 00:01:6c:9d:b9:fa GOSA ";
+ #$data = " 00:0C:29:4C:4B:0C GOSA ";
+ #$data = " $mac GOSA $mac";
+ #$data = " 00:0C:29:4C:4B:0C GOSA";
+ #$data = " gosa_trigger_action_faireboot 00:0C:29:4C:4B:0C GOSA ";
+ #$data = " gosa_trigger_action_reboot 00:0C:29:4C:4B:0C GOSA ";
+ #$data = " 00:0C:29:4C:4B:0C GOSA ";
+ #$data = " gosa_trigger_action_reinstall GOSA 00:0C:29:4C:4B:0C 00:0C:29:4C:4B:0C ";
+ #$data = " gosa_trigger_action_instant_update 00:0C:29:4C:4B:0C GOSA ";
#$data = " 00:01:6c:9d:b9:fa GOSA ";
-
# get_login_usr_for_client
- #$data = " gosa_get_login_usr_for_client GOSA GOSA 00:01:6c:9d:b9:fa";
+ #$data = " gosa_get_login_usr_for_client GOSA GOSA 00:0C:29:4C:4B:0C";
# get_client_for_login_usr
- #$data = " gosa_get_client_for_login_usr GOSA GOSA harald";
+ #$data = " gosa_get_client_for_login_usr GOSA GOSA rettenbe";
+
+ # List all si-server providing opsi
+ #$data = " gosa_get_hosts_with_module GOSA linux-cl-7:20081 opsi ";
+
+ # Send messages to a user and displayed message via konch
+ #$data = " GOSA GOSA ".base64_encode("eine wichtige nachricht")." admin polle harald 20130101235959 ".base64_encode("kaffeepause")." ";
+
+ #$data = " 10.89.1.31:20082 GOSA 00:01:6c:9d:b9:fa 1.2.3.4 20081212000000 ";
##################
# recreate fai dbs
@@ -82,10 +144,6 @@ for($count = 1; $count <= $zahl; $count++)
#$data = " gosa_recreate_fai_release_db GOSA GOSA";
#$data = " gosa_recreate_packages_list_db GOSA GOSA";
- ###########
- # messaging
- #$data = " GOSA GOSA ".base64_encode("eine wichtige nachricht")." admin polle rettenbe 20130101235959 ".base64_encode("kaffeepause")." ";
- #$data = " GOSA GOSA ".base64_encode("eine wichtige nachricht")." admin polle rettenbe 20130101235959 ".base64_encode("kaffeepause")." ";
################
# logHandling.pm
@@ -107,78 +165,128 @@ for($count = 1; $count <= $zahl; $count++)
#$data = " gosa_krb5_modify_principal 00:01:6c:9d:b9:fa horst@WIRECARD.SYSGOSA666";
#$data = "GOSA 10.89.1.131:20081";
- #$data = " 00:01:6c:9d:aa:16 GOSA ";
+ #$data = " 00:0C:29:4C:4B:0C GOSA ";
#$data = " 00:01:6c:9d:b9:fb GOSA ";
#$data = " GOSA GOSA ";
#$data = " GOSA 00:0c:29:02:e5:4d 00:0c:29:02:e5:4d29700101000000 ";
#$data = " gosa_network_completition GOSA GOSA localhost ";
- ########
+ ####################################################################
# Opsi testing
# Get all netboot products
- #$data = " gosa_opsi_get_netboot_products GOSA 00:01:6c:9d:aa:16 ";
+ #$data = " gosa_opsi_get_netboot_products GOSA GOSA ";
# Get netboot product for specific host
- # -->
- #$data = " gosa_opsi_get_netboot_products GOSA 00:01:6c:9d:aa:16 limux-cl-2.intranet.gonicus.de";
+ #$data = " gosa_opsi_get_netboot_products GOSA GOSA linux-cl-2.intranet.gonicus.de";
# Get all localboot products
- #$data = " gosa_opsi_get_local_products GOSA 00:01:6c:9d:aa:16 ";
+ #$data = " gosa_opsi_get_local_products GOSA GOSA ";
# Get localboot product for specific host
- #$data = " gosa_opsi_get_local_products GOSA 00:01:6c:9d:aa:16 limux-cl-2.intranet.gonicus.de";
+ #$data = " gosa_opsi_get_local_products GOSA GOSA linux-cl-2.intranet.gonicus.de";
# Get product properties - global
- #$data = " gosa_opsi_get_product_properties GOSA 00:01:6c:9d:aa:16 winxppro";
+ #$data = " gosa_opsi_get_product_properties GOSA GOSA xpconfig";
# Get product properties - per host
- #$data = " gosa_opsi_get_product_properties GOSA 00:01:6c:9d:aa:16 firefox limux-cl-2.intranet.gonicus.de ";
+ #$data = " gosa_opsi_get_product_properties GOSA GOSA firefox linux-cl-2.intranet.gonicus.de ";
# Set product properties - global
- #$data = " gosa_opsi_set_product_properties GOSA 00:01:6c:9d:aa:16 winxppro - askbeforeinstfalse
";
+ #$data = " gosa_opsi_set_product_properties GOSA 00:01:6c:9d:b9:fa javavm - askbeforeinstfalse
";
# Set product properties - per host
- #$data = " gosa_opsi_set_product_properties GOSA 00:01:6c:9d:aa:16 limux-cl-2.intranet.gonicus.de winxppro - askbeforeinstfalse
";
+ #$data = " gosa_opsi_set_product_properties GOSA 00:01:6c:9d:b9:fa linux-cl-2.intranet.gonicus.de firefox - askbeforeinst false
";
# Get hardware inventory
- #$data = " gosa_opsi_get_client_hardware GOSA 00:01:6c:9d:aa:16 limux-cl-2.intranet.gonicus.de ";
+ #$data = " gosa_opsi_get_client_hardware GOSA GOSA linux-cl-2.intranet.gonicus.de ";
+ #$data = " gosa_opsi_get_client_hardware GOSA GOSA metrischesgewinde.intranet.gonicus.de ";
+ #$data = " gosa_opsi_get_client_hardware GOSA GOSA der_neue.intranet.gonicus.de ";
# Get software inventory
- #$data = " gosa_opsi_get_client_software GOSA 00:01:6c:9d:aa:16 limux-cl-2.intranet.gonicus.de ";
+ #$data = " gosa_opsi_get_client_software GOSA GOSA linux-cl-2.intranet.gonicus.de ";
# List Opsi clients
- #$data = " GOSA 00:01:6c:9d:aa:16 ";
+ #$data = " GOSA GOSA ";
# Delete Opsi client
- #$data = " GOSA 00:01:6c:9d:aa:16 sdfgsg.intranet.gonicus.de";
+ #$data = " GOSA 00:01:6c:9d:b9:fa linux-cl-2.intranet.gonicus.de";
+
+ # Install Opsi client
+ # Please do always use 'job_...' and never 'gosa_...' otherways the job will never appear in job queue
+ #$data = " GOSA 00:01:6c:9d:b9:fa linux-cl-2.intranet.gonicus.de 00:11:25:4b:8c:e5 ";
+
+ # Add Opsi client
+ #$data = " GOSA 00:01:6c:9d:b9:fa linux-cl-2.intranet.gonicus.de 00:11:25:4b:8c:e5 Test halt 1.2.3.4 Im a note ";
+
+ # Add product to Opsi client
+ #$data = "gosa_opsi_add_product_to_clientGOSA$maclinux-cl-2.intranet.gonicus.dewinxppro";
+ #$data = "gosa_opsi_add_product_to_clientGOSA$maclinux-cl-2.intranet.gonicus.deacroread";
+ #$data = " gosa_opsi_add_product_to_client GOSA 00:01:6c:9d:b9:fa 00:11:25:4b:8c:e5 linux-cl-2.intranet.gonicus.de preloginloader ";
+
+ #$data = " gosa_opsi_add_product_to_client GOSA 00:01:6c:9d:b9:fa 00:11:25:4b:8c:e5 linux-cl-2.intranet.gonicus.de opsi-adminutils ";
+
+ #$data = " gosa_opsi_add_product_to_client GOSA 00:01:6c:9d:b9:fa 00:11:25:4b:8c:e5 linux-cl-2.intranet.gonicus.de xpconfig ";
+
+ #$data = " gosa_opsi_add_product_to_client GOSA 00:01:6c:9d:b9:fa 00:11:25:4b:8c:e5 linux-cl-2.intranet.gonicus.de hwaudit ";
+
+ #$data = " gosa_opsi_add_product_to_client GOSA 00:01:6c:9d:b9:fa 00:11:25:4b:8c:e5 linux-cl-2.intranet.gonicus.de javavm ";
+
+ #$data = " gosa_opsi_add_product_to_client GOSA 00:01:6c:9d:b9:fa 00:11:25:4b:8c:e5 linux-cl-2.intranet.gonicus.de firefox ";
+
+ #$data = " gosa_opsi_add_product_to_client GOSA 00:01:6c:9d:b9:fa 00:11:25:4b:8c:e5 linux-cl-2.intranet.gonicus.de flashplayer ";
+
+ # Delete product from Opsi client
+ #$data = " gosa_opsi_del_product_from_client GOSA 00:01:6c:9d:b9:fa linux-cl-1.intranet.gonicus.de 00:11:25:4b:8c:e5 wipedisk ";
#########################
# Mailqueue communication
+
+ # Writing data into a mailqueue
+ #echo sabber | mail -s test horst@woauchimmer.de
+
+ # Querying the mailqueue at
#$data = " GOSA 00:01:6c:9d:b9:fa ";
+ #$data = " GOSA 00:01:6c:9d:b9:fa recipient eq retta ";
- # multiple xml tags msg_id are allowed
+ # Multiple xml tags msg_id are allowed
#$data = " GOSA 00:01:6c:9d:b9:fa 99C8ABEF23 ";
#$data = " GOSA 00:01:6c:9d:b9:fa 5657EBEEF7 ";
#$data = " GOSA 00:01:6c:9d:b9:fa 11A09BEF04 ";
- #$data = " GOSA 00:01:6c:9d:b9:fa 11A09BEF04 ";
+ #$data = " GOSA 00:01:6c:9d:b9:fa CEAFDBEF45 ";
- # only one xml tag msg_id is allowed
- #$data = " GOSA 00:01:6c:9d:b9:fa 99E92BEF2B ";
+ # Only one xml tag msg_id is allowed
+ #$data = " GOSA 00:01:6c:9d:b9:fa EFD81BEF45 ";
########################
# DAK Debian Archive Kit
- $data = " GOSA 00:01:6c:9d:b9:fa ";
+ #$data = " GOSA 00:01:6c:9d:b9:fa ";
#$data = " GOSA 00:01:6c:9d:b9:fa ";
#$data = " GOSA 00:01:6c:9d:b9:fa ";
+
+ ##############################
+ # NTP reload
+ #$data = " gosa_trigger_reload_ntp_config GOSA GOSA 00:0C:29:4C:4B:0C ";
+
+ ##############################
+ # SYSLOG reload
+ #$data = " gosa_trigger_reload_syslog_config GOSA GOSA 00:0C:29:4C:4B:0C ";
+
+
+ $time_start = microtime_float();
+
$sock->write($data);
$answer = "nothing";
$answer = $sock->read();
-
echo "$count: $answer\n";
$sock->close();
+
+ $time_end = microtime_float();
+ $time = $time_end - $time_start;
+ echo "Processing time: $time seconds\n";
+
}else{
echo "... FAILED!\n";
}