Code

Added possibility to set state and action
[gosa.git] / gosa-si / tests / client.php
index 461ce429399b6957f56c41736c1b87dea590fe66..2ca8ffae44df9cb1f6eaacb2ade9ae076cb8105a 100755 (executable)
@@ -11,8 +11,8 @@ 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.3.67.111","20081",TRUE,5);
-  #$sock->setEncryptionKey("UldOjon9gra");
+  #$sock = new Socket_Client("10.89.1.30","20081",TRUE,5);
+  #$sock->setEncryptionKey("secret-gosa-password");
 
   if($sock->connected()){
 
@@ -20,8 +20,8 @@ for($count = 1; $count <= $zahl; $count++)
     # jobdb add
     #$data = "<xml> <header>gosa_network_completition</header> <source>GOSA</source><target>GOSA</target><hostname>ws-muc-2</hostname></xml>";
     #$data = "<xml> <header>job_sayHello</header> <source>10.89.1.155:20083</source><target>00:01:6c:9d:b9:fa</target><mac>00:1B:77:04:8A:6C</mac> <timestamp>20130102133908</timestamp> </xml>";
-    #$data = "<xml> <header>job_ping</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <macaddress>00:01:6c:9d:b9:fa</macaddress><timestamp>19700101000000</timestamp> </xml>";
-
+    #$data = "<xml> <header>job_ping</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <macaddress>00:01:6c:9d:b9:fa</macaddress><timestamp>20130101000000</timestamp> </xml>";
+  
     # jobdb delete
     #$data = "<xml> <header>gosa_delete_jobdb_entry</header> <source>GOSA</source> <target>GOSA</target> <where><clause><phrase><id>3</id></phrase></clause></where></xml>";
 
@@ -59,11 +59,12 @@ for($count = 1; $count <= $zahl; $count++)
 
 
     # trigger jobs at client
-    #$data = "<xml> <header>gosa_detect_hardware</header> <target>10.89.1.31:20083</target> <source>10.89.1.31:20081</source> </xml>";
+    #$data = "<xml> <header>gosa_detect_hardware</header> <target>10.89.1.31:20083</target> <source>GOSA</source> </xml>";
     #$data = "<xml> <header>gosa_new_key_for_client</header> <target>00:01:6c:9d:b9:fa</target> <source>10.89.1.31:20081</source> </xml>";
     #$data = "<xml> <header>job_trigger_action_wake</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> <timestamp>19700101000000</timestamp></xml>";
     #$data = "<xml> <header>gosa_trigger_action_faireboot</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
     #$data = "<xml> <header>gosa_trigger_action_reboot</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
+    #$data = "<xml> <header>gosa_trigger_action_halt</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
     #$data = "<xml> <header>job_trigger_action_reinstall</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <macaddress>00:01:6c:9d:b9:fa</macaddress> <timestamp>19700101000000</timestamp> </xml>";
     #$data = "<xml> <header>job_trigger_action_instant_update</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> <timestamp>19700101000000</timestamp> </xml>";
     #$data = "<xml> <header>gosa_new_ping</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
@@ -105,8 +106,48 @@ for($count = 1; $count <= $zahl; $count++)
     #$data = "<xml> <header>gosa_krb5_create_principal</header> <target>00:01:6c:9d:aa:16</target> <principal>horst@WIRECARD.SYS</principal><source>GOSA</source><max_life>666</max_life></xml>"; 
     #$data = "<xml> <header>gosa_krb5_modify_principal</header> <target>00:01:6c:9d:b9:fa</target> <principal>horst@WIRECARD.SYS</principal><source>GOSA</source><max_life>666</max_life></xml>"; 
 
-    $data = "<xml><header>gosa_query_fai_server</header><source>GOSA</source> <target>10.89.1.131:20081</target></xml>";
-    #$data = "<xml> <header>gosa_new_ping</header> <target>00:0c:29:02:e5:4d</target> <source>GOSA</source> </xml>";
+    #$data = "<xml><header>gosa_query_fai_server</header><source>GOSA</source> <target>10.89.1.131:20081</target></xml>";
+    #$data = "<xml> <header>gosa_ping</header> <target>00:01:6c:9d:aa:16</target> <source>GOSA</source> </xml>";
+    #$data = "<xml> <header>gosa_ping</header> <target>00:01:6c:9d:b9:fb</target> <source>GOSA</source> </xml>";
+    #$data = "<xml> <header>gosa_get_dak_keyring</header> <target>GOSA</target> <source>GOSA</source> </xml>";
+    #$data = "<xml> <header>job_ping</header> <source>GOSA</source> <target>00:0c:29:02:e5:4d</target> <macaddress>00:0c:29:02:e5:4d</macaddress><timestamp>29700101000000</timestamp> </xml>";
+
+    #$data = "<xml> <header>gosa_network_completition</header> <source>GOSA</source> <target>GOSA</target> <hostname>localhost</hostname> </xml>";
+
+    ########
+    # Opsi testing
+
+    # Get all netboot products
+    #$data = "<xml> <header>gosa_opsi_get_netboot_products</header> <source>GOSA</source> <target>00:01:6c:9d:aa:16</target> </xml>";
+
+    # Get netboot product for specific host
+    # -->
+    #$data = "<xml> <header>gosa_opsi_get_netboot_products</header> <source>GOSA</source> <target>00:01:6c:9d:aa:16</target> <hostId>limux-cl-2.intranet.gonicus.de</hostId></xml>";
+
+    # Get all localboot products
+    $data = "<xml> <header>gosa_opsi_get_local_products</header> <source>GOSA</source> <target>00:01:6c:9d:aa:16</target> </xml>";
+    
+    # Get localboot product for specific host
+    #$data = "<xml> <header>gosa_opsi_get_local_products</header> <source>GOSA</source> <target>00:01:6c:9d:aa:16</target> <hostId>limux-cl-2.intranet.gonicus.de</hostId></xml>";
+
+    # Get product properties - global
+    $data = "<xml> <header>gosa_opsi_get_product_properties</header> <source>GOSA</source> <target>00:01:6c:9d:aa:16</target> <ProductId>winxppro</ProductId></xml>";
+
+    # Get product properties - per host
+    #$data = "<xml> <header>gosa_opsi_get_product_properties</header> <source>GOSA</source> <target>00:01:6c:9d:aa:16</target> <ProductId>firefox</ProductId> <hostId>limux-cl-2.intranet.gonicus.de</hostId> </xml>";
+
+    # Set product properties - global
+    #$data = "<xml> <header>gosa_opsi_set_product_properties</header> <source>GOSA</source> <target>00:01:6c:9d:aa:16</target> <ProductId>winxppro</ProductId> <item><name>askbeforeinst</name><value>false</value></item></xml>";
+
+    # Set product properties - per host
+    #$data = "<xml> <header>gosa_opsi_set_product_properties</header> <source>GOSA</source> <target>00:01:6c:9d:aa:16</target> <hostId>limux-cl-2.intranet.gonicus.de</hostId> <ProductId>winxppro</ProductId> <item><name>askbeforeinst</name><value>false</value></item></xml>";
+
+    # Get hardware inventory
+    #$data = "<xml> <header>gosa_opsi_get_client_hardware</header> <source>GOSA</source> <target>00:01:6c:9d:aa:16</target> <hostId>limux-cl-2.intranet.gonicus.de</hostId> </xml>";
+    
+    # Get software inventory
+    #$data = "<xml> <header>gosa_opsi_get_client_software</header> <source>GOSA</source> <target>00:01:6c:9d:aa:16</target> <hostId>limux-cl-2.intranet.gonicus.de</hostId> </xml>";
+
 
     $sock->write($data);
     $answer = "nothing";