X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-si%2Ftests%2Fclient.php;h=84c5d701a586e3159b259861cb5857f3cb50e721;hb=06fd60ccdfa1f960ece1310f9d74d6992261ffc0;hp=1c40df4f612827feb717d016a8a97099730800ad;hpb=d153401dbb614f0838e7a4e0c3d8c8f2a0870dc8;p=gosa.git
diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php
index 1c40df4f6..84c5d701a 100755
--- a/gosa-si/tests/client.php
+++ b/gosa-si/tests/client.php
@@ -4,113 +4,291 @@
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++)
{
-$sock = new Socket_Client("127.0.0.1","20081",TRUE,1);
-$sock->setEncryptionKey("secret-gosa-password");
+ $sock = new Socket_Client("127.0.0.1","20081",TRUE,5);
+ $sock->setEncryptionKey("secret-gosa-password");
+ #$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";
+ #$data = " 10.89.1.155:2008300:01:6c:9d:b9:fa00:1B:77:04:8A:6C 20130102133908 ";
+ #$data = " GOSA 00:01:6c:9d:b9:fa 00:01:6c:9d:b9:fa20130101000000 ";
+
+ # jobdb delete
+ #$data = " GOSA GOSA 3";
+
+ # smbhash
+ #$data = " GOSAGOSArettenbe";
+
+ # Reload ldap config
+ #$data = " gosa_trigger_reload_ldap_config GOSA00:0C:29:4C:4B:0C";
+
+ # jobdb update
+ #$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
+ #$data = "GOSA GOSAandgt0le5";
+ #$data = "GOSA GOSA like %0102% ";
+ #$data= "GOSA GOSAping03";
+ #$data= "GOSA GOSAtrigger_action_reinstall025timestamp DESC";
+ #$data= "GOSA GOSA";
+ #$data= "GOSA GOSA";
+ #$data= "GOSA GOSA";
+ #$data= "GOSA GOSA";
+
+
+ # jobdb count
+ #$data = " GOSA GOSA";
+ #$data = " GOSA GOSA";
+ #$data = " GOSA GOSA";
-if($sock->connected()){
- /* Prepare a hunge bunch of data to be send */
+ # jobdb clear
+ #$data = " GOSA GOSA";
-# jobdb add
-#$data = " gosa_network_completition GOSAGOSAws-muc-2";
-#$data = " 10.89.1.155:2008300:01:6c:9d:b9:fa00:1B:77:04:8A:6C 20130102133908 ";
-#$data = " GOSA 00:01:6c:9d:b9:fa 00:01:6c:9d:b9:fa19700101000000 ";
+ # set gosa-si-client to 'activated'
+ #$data = " gosa_set_activated_for_installation 00:0C:29:4C:4B:0C GOSA 00:0C:29:4C:4B:0C22220101000000";
-# jobdb delete
-#$data = " GOSA GOSA 1";
+ # trigger jobs at client
+ #$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 ";
-# smbhash
-#$data = " GOSAGOSAtester";
+ # get_login_usr_for_client
+ #$data = " gosa_get_login_usr_for_client GOSA GOSA 00:0C:29:4C:4B:0C";
-# Reload ldap config
-#$data = " gosa_trigger_reload_ldap_config GOSA00:01:6c:9d:b9:fa";
+ # get_client_for_login_usr
+ #$data = " gosa_get_client_for_login_usr GOSA GOSA rettenbe";
-# jobdb update
-#$data = " gosa_update_status_jobdb_entry GOSA GOSA 1 19700101000000";
-#$data = " gosa_update_status_jobdb_entry GOSAGOSA 00:01:6c:9d:b9:fa processing update";
+ # List all si-server providing opsi
+ #$data = " gosa_get_hosts_with_module GOSA linux-cl-7:20081 opsi ";
-# jobdb query
-#$data = "GOSA GOSAandgt0le5";
-#$data = "GOSA GOSA like %0102% ";
-#$data= "GOSA GOSAping03";
-#$data= "GOSA GOSAtrigger_action_reinstall025timestamp DESC";
-#$data= "GOSA GOSA";
-#$data= "GOSA GOSA";
-#$data= "GOSA GOSA";
-#$data= "GOSA GOSA";
+ # 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
+ #$data = " gosa_recreate_fai_server_db GOSA GOSA";
+ #$data = " gosa_recreate_fai_release_db GOSA GOSA";
+ #$data = " gosa_recreate_packages_list_db GOSA GOSA";
+
+
+ ################
+ # logHandling.pm
+ # all date and mac parameter accept regular expression as input unless other instructions are given
+ # show_log_by_mac, show_log_by_date, show_log_by_date_and_mac, show_log_files_by_date_and_mac,
+ # get_log_file_by_date_and_mac, delete_log_by_date_and_mac, get_recent_log_by_mac
+ #$data = " GOSA GOSA 00:01:6C:9D:B9:FA 00:01:6c:9d:b9:fb ";
+ #$data = " GOSA GOSA 20080313 20080323 ";
+ #$data = " gosa_show_log_by_date_and_mac GOSA GOSA 200803 00:01:6c:9d:b9:FA ";
+ #$data = " gosa_delete_log_by_date_and_mac GOSA GOSA 00:01:6c:9d:b9:fa";
+ #$data = " gosa_get_recent_log_by_mac GOSA GOSA 00:01:6c:9d:b9:fa";
+ # exact date and mac are required as input
+ #$data = " gosa_show_log_files_by_date_and_mac GOSA GOSA install_20080311_090900 00:01:6c:9d:b9:fa ";
+ #$data = " gosa_get_log_file_by_date_and_mac GOSA GOSA install_20080311_090900 00:01:6c:9d:b9:fa boot.log";
+
+ #########
+ # Kerberos test query
+ #$data = " gosa_krb5_create_principal 00:01:6c:9d:aa:16 horst@WIRECARD.SYSGOSA666";
+ #$data = " gosa_krb5_modify_principal 00:01:6c:9d:b9:fa horst@WIRECARD.SYSGOSA666";
+
+ #$data = "GOSA 10.89.1.131:20081";
+ #$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 GOSA ";
+
+ # Get netboot product for specific host
+ #$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 GOSA ";
+
+ # Get localboot product for specific host
+ #$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 GOSA xpconfig";
+
+ # Get product properties - per host
+ #$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:b9:fa javavm - askbeforeinstfalse
";
+ # Set product properties - per host
+ #$data = " gosa_opsi_set_product_properties GOSA 00:01:6c:9d:b9:fa linux-cl-2.intranet.gonicus.de firefox - askbeforeinst false
";
-# jobdb count
-#$data = " GOSA GOSA";
-#$data = " GOSA GOSA";
-#$data = " GOSA GOSA";
+ # Get hardware inventory
+ #$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 GOSA linux-cl-2.intranet.gonicus.de ";
-# jobdb clear
-#$data = " GOSA GOSA";
+ # List Opsi clients
+ #$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";
+ # Delete Opsi client
+ #$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 ";
-# trigger jobs at client
-#$data = " 10.89.1.31:20083 10.89.1.31:20081 ";
-#$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 = " 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 = " 00:01:6c:9d:b9:fa GOSA ";
+ # 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 ";
-# get_login_usr_for_client
-#$data = " gosa_get_login_usr_for_client GOSA GOSA 00:01:6c:9d:b9:fa";
+ # 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 ";
-# get_client_for_login_usr
-#$data = " gosa_get_client_for_login_usr GOSA GOSA harald";
+ #########################
+ # Mailqueue communication
+
+ # Writing data into a mailqueue
+ #echo sabber | mail -s test horst@woauchimmer.de
-##################
-# recreate fai dbs
-#$data = " gosa_recreate_fai_server_db GOSA GOSA";
-$data = " gosa_recreate_fai_release_db GOSA GOSA";
-#$data = " gosa_recreate_packages_list_db GOSA GOSA";
+ # Querying the mailqueue at
+ #$data = " GOSA 00:01:6c:9d:b9:fa ";
+ #$data = " GOSA 00:01:6c:9d:b9:fa recipient eq retta ";
-###########
-# messaging
-#$data = " GOSA GOSA eine wichtige nachricht admin rettenbe 20130101235959 kaffeepause ";
+ # 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 CEAFDBEF45 ";
+ # 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 ";
-################
-# logHandling.pm
-# all date and mac parameter accept regular expression as input unless other instructions are given
-# show_log_by_mac, show_log_by_date, show_log_by_date_and_mac, show_log_files_by_date_and_mac,
-# get_log_file_by_date_and_mac, delete_log_by_date_and_mac, get_recent_log_by_mac
-#$data = " GOSA GOSA 00:01:6C:9D:B9:FA 00:01:6c:9d:b9:fb ";
-#$data = " GOSA GOSA 20080313 20080323 ";
-#$data = " gosa_show_log_by_date_and_mac GOSA GOSA 200803 00:01:6c:9d:b9:FA ";
-#$data = " gosa_delete_log_by_date_and_mac GOSA GOSA 00:01:6c:9d:b9:fa";
-#$data = " gosa_get_recent_log_by_mac GOSA GOSA 00:01:6c:9d:b9:fa";
-# exact date and mac are required as input
-#$data = " gosa_show_log_files_by_date_and_mac GOSA GOSA install_20080311_090900 00:01:6c:9d:b9:fa ";
-#$data = " gosa_get_log_file_by_date_and_mac GOSA GOSA install_20080311_090900 00:01:6c:9d:b9:fa boot.log";
-#########
-# testing
-#$data = " GOSA GOSA";
+ ##############################
+ # 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();
-
+ $answer = $sock->read();
echo "$count: $answer\n";
- $sock->close();
-}else{
- echo "... FAILED!\n";
-}
+ $sock->close();
+
+ $time_end = microtime_float();
+ $time = $time_end - $time_start;
+ echo "Processing time: $time seconds\n";
+
+ }else{
+ echo "... FAILED!\n";
+ }
}
?>