Code

Do not request a password for each created object, we may have created a template
[gosa.git] / gosa-si / tests / client.php
index f01246d9ebffef2860422c38ad033ea01e5e6c88..84c5d701a586e3159b259861cb5857f3cb50e721 100755 (executable)
@@ -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++)
@@ -51,13 +57,14 @@ for($count = 1; $count <= $zahl; $count++)
 
        #$data = "<xml><header>gosa_opsi_removeLicense</header><source>GOSA</source><target>00:01:6C:9D:B9:FA</target><licensePoolId>LicensePool</licensePoolId><softwareLicenseId>l_2009-09-22_14:06:11</softwareLicenseId></xml>";
 
-       #$data = "<xml><header>gosa_opsi_getReservedLicenses</header><source>GOSA</source><target>00:01:6C:9D:B9:FA</target><hostId>krakenarme.intranet.gonicus.de</hostId></xml>";
+       #$data = "<xml><header>gosa_opsi_getReservedLicenses</header><source>GOSA</source><target>00:01:6C:9D:B9:FA</target><hostId>linux-cl-2.intranet.gonicus.de</hostId></xml>";
 
        #$data = "<xml><header>gosa_opsi_boundHostToLicense</header><source>GOSA</source><target>00:01:6C:9D:B9:FA</target><softwareLicenseId>andisLizenz</softwareLicenseId><hostId>krakenarme.intranet.gonicus.de</hostId></xml>";
        #$data = "<xml><header>gosa_opsi_unboundHostFromLicense</header><source>GOSA</source><target>00:01:6C:9D:B9:FA</target><softwareLicenseId>andisLizenz</softwareLicenseId></xml>";
 
-       $data = "<xml><header>gosa_opsi_getAllSoftwareLicenses</header><source>GOSA</source><target>00:01:6C:9D:B9:FA</target></xml>";
+       #$data = "<xml><header>gosa_opsi_getAllSoftwareLicenses</header><source>GOSA</source><target>00:01:6C:9D:B9:FA</target></xml>";
 
+       $data = "<xml><header>gosa_opsi_get_full_product_host_information</header><source>GOSA</source><target>00:01:6C:9D:B9:FA</target><hostId>linux-cl-2.intranet.gonicus.de</hostId></xml>";
 
        ##############################
        # periodical jobs
@@ -108,7 +115,7 @@ for($count = 1; $count <= $zahl; $count++)
     # trigger jobs at client
     #$data = "<xml> <header>gosa_trigger_goto_settings_reload</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
     #$data = "<xml> <header>gosa_detect_hardware</header> <target>00:0C:29:4C:4B:0C</target> <source>GOSA</source> </xml>";
-    #$data = "<xml> <header>gosa_new_key_for_client</header> <target>00:0C:29:4C:4B:0C</target> <source>GOSA</source> </xml>";
+    #$data = "<xml> <header>gosa_new_key_for_client</header> <target>$mac</target> <source>GOSA</source> <macaddress>$mac</macaddress></xml>";
     #$data = "<xml> <header>gosa_trigger_action_wake</header> <target>00:0C:29:4C:4B:0C</target> <source>GOSA</source></xml>";
     #$data = "<xml> <header>gosa_trigger_action_faireboot</header> <target>00:0C:29:4C:4B:0C</target> <source>GOSA</source> </xml>";
     #$data = "<xml> <header>gosa_trigger_action_reboot</header> <target>00:0C:29:4C:4B:0C</target> <source>GOSA</source> </xml>";
@@ -194,6 +201,7 @@ for($count = 1; $count <= $zahl; $count++)
 
     # Get hardware inventory
     #$data = "<xml> <header>gosa_opsi_get_client_hardware</header> <source>GOSA</source> <target>GOSA</target> <hostId>linux-cl-2.intranet.gonicus.de</hostId> </xml>";
+    #$data = "<xml> <header>gosa_opsi_get_client_hardware</header> <source>GOSA</source> <target>GOSA</target> <hostId>metrischesgewinde.intranet.gonicus.de</hostId> </xml>";
     #$data = "<xml> <header>gosa_opsi_get_client_hardware</header> <source>GOSA</source> <target>GOSA</target> <hostId>der_neue.intranet.gonicus.de</hostId> </xml>";
     
     # Get software inventory
@@ -267,13 +275,18 @@ for($count = 1; $count <= $zahl; $count++)
     #$data = "<xml> <header>gosa_trigger_reload_syslog_config</header> <source>GOSA</source> <target>GOSA</target> <macaddress>00:0C:29:4C:4B:0C</macaddress> </xml>"; 
 
 
+       $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";
   }