X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-si%2Ftests%2Fclient.php;h=84c5d701a586e3159b259861cb5857f3cb50e721;hb=3a085d0d025b5432f2316995ff2e8a2f027eed84;hp=7a92a4c0b5da30ced6135cfb3e27b7eec7e0a63e;hpb=1fa27d58342e7f89fecd515f7690558cee0cc6d1;p=gosa.git diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index 7a92a4c0b..84c5d701a 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -4,33 +4,89 @@ 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 = 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 = "
gosa_opsi_test
GOSA00:01:6C:9D:B9:FAacroread
"; + + #$data = "
gosa_opsi_getLicenseInformationForProduct
GOSA00:01:6C:9D:B9:FApython
"; + #$data = "
gosa_opsi_getLicenseInformationForProduct
GOSA00:01:6C:9D:B9:FAfirefox
"; + + #$data = "
gosa_opsi_getLicensePools_listOfHashes
GOSA00:01:6C:9D:B9:FA
"; + + #$data = "
gosa_opsi_getLicensePool_hash
GOSA00:01:6C:9D:B9:FALicensePool
"; + + #$data = "
gosa_opsi_createLicensePool
GOSA00:01:6C:9D:B9:FAHaraldDas 134te Schaafacrobatwinzip
"; + + #$data = "
gosa_opsi_deleteLicensePool
GOSA00:01:6C:9D:B9:FASusi
"; + + #$data = "
gosa_opsi_createLicense
GOSA00:01:6C:9D:B9:FAGonicus GmbHI'm a note!1LicensePoolabcdefghiandisLizenzVOLUMEkrakenarme.intranet.gonicus.de
"; + + #$data = "
gosa_opsi_assignSoftwareLicenseToHost
GOSA00:01:6C:9D:B9:FASusilinux-cl-2.intranet.gonicus.de
"; + + #$data = "
gosa_opsi_unassignSoftwareLicenseFromHost
GOSA00:01:6C:9D:B9:FASusilinux-cl-2.intranet.gonicus.de
"; + + #$data = "
gosa_opsi_unassignAllSoftwareLicensesFromHost
GOSA00:01:6C:9D:B9:FAlinux-cl-2.intranet.gonicus.de
"; + + #$data = "
gosa_opsi_getSoftwareLicenseUsages
GOSA00:01:6C:9D:B9:FAkrakenarme.intranet.gonicus.de
"; + #$data = "
gosa_opsi_getSoftwareLicenseUsages
GOSA00:01:6C:9D:B9:FALicensePool
"; + #$data = "
gosa_opsi_getSoftwareLicenseUsages
GOSA00:01:6C:9D:B9:FA
"; + #$data = "
gosa_opsi_getSoftwareLicenseUsagesForProductId
GOSA00:01:6C:9D:B9:FAfirefox
"; + + #$data = "
gosa_opsi_getSoftwareLicense_hash
GOSA00:01:6C:9D:B9:FAl_2009-09-22_09:50:58_0
"; + + #$data = "
gosa_opsi_getPool
GOSA00:01:6C:9D:B9:FALicensePool
"; + + #$data = "
gosa_opsi_removeLicense
GOSA00:01:6C:9D:B9:FALicensePooll_2009-09-22_14:06:11
"; + + #$data = "
gosa_opsi_getReservedLicenses
GOSA00:01:6C:9D:B9:FAlinux-cl-2.intranet.gonicus.de
"; + + #$data = "
gosa_opsi_boundHostToLicense
GOSA00:01:6C:9D:B9:FAandisLizenzkrakenarme.intranet.gonicus.de
"; + #$data = "
gosa_opsi_unboundHostFromLicense
GOSA00:01:6C:9D:B9:FAandisLizenz
"; + + #$data = "
gosa_opsi_getAllSoftwareLicenses
GOSA00:01:6C:9D:B9:FA
"; + + $data = "
gosa_opsi_get_full_product_host_information
GOSA00:01:6C:9D:B9:FAlinux-cl-2.intranet.gonicus.de
"; + + ############################## + # periodical jobs + #$data = "
job_trigger_action_reboot
GOSA00:0c:29:4c:4b:0c00:0c:29:4c:4b:0c234506290000003_months
"; + #$data = "
job_trigger_action_reboot
GOSA00: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 = "
job_sayHello
10.89.1.155:2008300:01:6c:9d:b9:fa00:1B:77:04:8A:6C 20130102133908
"; - #$data = "
job_ping
GOSA 00:01:6c:9d:b9:fa 00:01:6c:9d:b9:fa19700101000000
"; - + #$data = "
job_ping
GOSA 00:01:6c:9d:b9:fa 00:01:6c:9d:b9:fa20130101000000
"; + # jobdb delete - #$data = "
gosa_delete_jobdb_entry
GOSA GOSA 1
"; + #$data = "
gosa_delete_jobdb_entry
GOSA GOSA 3
"; # smbhash - #$data = "
gosa_gen_smb_hash
GOSAGOSAtester
"; + #$data = "
gosa_gen_smb_hash
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 @@ -53,25 +109,34 @@ for($count = 1; $count <= $zahl; $count++) #$data = "
gosa_clear_jobdb
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 = "
gosa_detect_hardware
10.89.1.31:20083 10.89.1.31:20081
"; - #$data = "
gosa_new_key_for_client
00:01:6c:9d:b9:fa 10.89.1.31:20081
"; - #$data = "
job_trigger_action_wake
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 = "
gosa_ping
00:01:6c:9d:b9:fa GOSA
"; - + #$data = "
gosa_trigger_goto_settings_reload
00:01:6c:9d:b9:fa GOSA
"; + #$data = "
gosa_detect_hardware
00:0C:29:4C:4B:0C GOSA
"; + #$data = "
gosa_new_key_for_client
$mac GOSA $mac
"; + #$data = "
gosa_trigger_action_wake
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 = "
gosa_trigger_action_halt
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 = "
gosa_new_ping
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_send_user_msg
GOSA GOSA ".base64_encode("eine wichtige nachricht")." admin polle harald 20130101235959 ".base64_encode("kaffeepause")."
"; + + #$data = "
gosa_set_last_system
10.89.1.31:20082 GOSA 00:01:6c:9d:b9:fa 1.2.3.4 20081212000000
"; ################## # recreate fai dbs @@ -79,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_send_user_msg
GOSA GOSA eine wichtige nachricht admin rettenbe 20130101235959 kaffeepause
"; - ################ # logHandling.pm @@ -99,18 +160,133 @@ for($count = 1; $count <= $zahl; $count++) #$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_query_packages_list
GOSA GOSA
"; - # Kerberos test query - $data = "
gosa_krb5_list_principals
00:0C:29:DD:CD:2A GOSA
"; + #$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_query_fai_server
GOSA 10.89.1.131:20081
"; + #$data = "
gosa_ping
00:0C:29:4C:4B:0C GOSA
"; + #$data = "
gosa_ping
00:01:6c:9d:b9:fb GOSA
"; + #$data = "
gosa_get_dak_keyring
GOSA GOSA
"; + #$data = "
job_ping
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
"; + + # 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
"; + + # List Opsi clients + #$data = "
gosa_opsi_list_clients
GOSA GOSA
"; + + # Delete Opsi client + #$data = "
gosa_opsi_del_client
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 = "
job_opsi_install_client
GOSA 00:01:6c:9d:b9:fa linux-cl-2.intranet.gonicus.de 00:11:25:4b:8c:e5
"; + + # Add Opsi client + #$data = "
gosa_opsi_add_client
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_client
GOSA$maclinux-cl-2.intranet.gonicus.dewinxppro
"; + #$data = "
gosa_opsi_add_product_to_client
GOSA$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_mailqueue_query
GOSA 00:01:6c:9d:b9:fa
"; + #$data = "
gosa_mailqueue_query
GOSA 00:01:6c:9d:b9:fa recipient eq retta
"; + + # Multiple xml tags msg_id are allowed + #$data = "
gosa_mailqueue_hold
GOSA 00:01:6c:9d:b9:fa 99C8ABEF23
"; + #$data = "
gosa_mailqueue_unhold
GOSA 00:01:6c:9d:b9:fa 5657EBEEF7
"; + #$data = "
gosa_mailqueue_requeue
GOSA 00:01:6c:9d:b9:fa 11A09BEF04
"; + #$data = "
gosa_mailqueue_del
GOSA 00:01:6c:9d:b9:fa CEAFDBEF45
"; + + # Only one xml tag msg_id is allowed + #$data = "
gosa_mailqueue_header
GOSA 00:01:6c:9d:b9:fa EFD81BEF45
"; + + ######################## + # DAK Debian Archive Kit + #$data = "
gosa_get_dak_keyring
GOSA 00:01:6c:9d:b9:fa
"; + #$data = "
gosa_import_dak_key
GOSA 00:01:6c:9d:b9:fa
"; + #$data = "
gosa_remove_dak_key
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"; }