From 7345880a5e2c3f863b4ec7eef5ea90075095f385 Mon Sep 17 00:00:00 2001
From: Christophe Sovant <christophe.sovant@forgerock.com>
Date: Tue, 13 May 2008 20:03:19 +0000
Subject: [PATCH] Fix a problem in createTopology() when the SNMP_OPENDMK_LIBDIR variable is not set

---
 opendj-sdk/opends/tests/shared/functions/topology.xml |  185 ++++++++++++++++++++++++---------------------
 1 files changed, 99 insertions(+), 86 deletions(-)

diff --git a/opendj-sdk/opends/tests/shared/functions/topology.xml b/opendj-sdk/opends/tests/shared/functions/topology.xml
index 88f793f..94c11d1 100755
--- a/opendj-sdk/opends/tests/shared/functions/topology.xml
+++ b/opendj-sdk/opends/tests/shared/functions/topology.xml
@@ -326,100 +326,113 @@
             }
           </call>          
           
-          <!---   Check if snmp java files are already compiled -->
-          <call function="'listFolderByExtension'" >
-            { 
-            'location'   : STAXServiceMachine,
-            'foldername' : javaLocalDir,
-            'extension'  : 'class'
+          <!-- Check if 'SNMP_OPENDMK_LIBDIR' exists -->
+          <call function="'GetEntry'">
+            {
+            'location'  : STAXServiceMachine,
+            'entry'     : SNMP_OPENDMK_LIBDIR,
+            'attribute' : 'TYPE'
             }
           </call>
-          <if expr="STAXResult != ''">
-            <sequence>
-              <!--- Install DS Copy zip file -->
-              <message>
-                'Copy DS zip archive locally to %s.' % TMPDIR
-              </message>
-              <call function="'copyFile'">
+          <!-- 'SNMP_OPENDS_JARFILE' exists so we can continue -->
+          <if expr="RC != 48">
+            <sequence>          
+              <!---   Check if snmp java files are already compiled -->
+              <call function="'listFolderByExtension'" >
                 { 
-                'srcfile'    : '%s/%s' % (ZIPPATH, ZIPNAME),
-                'destfile'   : '%s/%s' % (TMPDIR, ZIPNAME),
-                'remotehost' : STAXServiceMachine
-                }
-              </call>
-              
-              <!--- Install DS Extract zip file -->
-              <message>
-                'Extract locally DS zip archive to %s' % TMPDIR
-              </message>
-              <call function="'unZipFile'">
-                { 
-                'location' : STAXServiceMachine,
-                'zipfile'  : '%s/%s' % (TMPDIR, ZIPNAME),
-                'unzipdir' : TMPDIR
-                }
-              </call>
- 
-              <call function="'ResolveVar'" >
-                { 
-                'location' : STAXServiceMachine,
-                'type'     : 'STRING',
-                'name'     : 'STAF/Env/LD_LIBRARY_PATH'
-                }
-              </call>                                                       
-              <script>jstaf_jarfile = '%s/JSTAF.jar' % STAFResult</script> 
-              
-              <!---   Compile snmp java files on controler host -->
-              <message>
-                'Compile Java files under %s on %s' \
-                % (javaLocalDir, STAXServiceMachine)
-              </message>
-              <call function="'compileJava'" >
-                {
                 'location'   : STAXServiceMachine,
                 'foldername' : javaLocalDir,
-                'classpath'  : '%s:%s:%s' \
-                % (SNMP_OPENDS_JARFILE, SNMP_OPENDMK_JARFILE, jstaf_jarfile)
+                'extension'  : 'class'
                 }
               </call>
-              
-              <!--  Delete the DS zip archive -->
-              <message>
-                'Delete %s/%s' % (TMPDIR, ZIPNAME)
-              </message>
-              <call function="'deleteFile'">
-                { 
-                'location' : STAXServiceMachine,
-                'filename' : '%s/%s' % (TMPDIR, ZIPNAME)
-                }
-              </call>
-              
-              <!--  Delete the DS install dir -->
-              <message>
-                'Delete %s/%s' % (TMPDIR, OPENDSNAME)
-              </message>
-              <call function="'deleteFolder'">
-                { 
-                'location' : STAXServiceMachine,
-                'foldername' : '%s/%s' % (TMPDIR, OPENDSNAME)
-                }
-              </call>
-              
-              <!-- Archive SNMP_OPENDMK_JARFILE file -->
-              <message>
-                'Copy OpenDMK jar file %s locally to %s.' \
-                % (SNMP_OPENDMK_JARFILE,javaLocalDir)
-              </message>
-              <call function="'copyFile'">
-                { 
-                'remotehost' : STAXServiceMachine,
-                'srcfile'    : SNMP_OPENDMK_JARFILE,
-                'destfile'   : '%s/jdmkrt.jar' % javaLocalDir,
-                'remotehost' : STAXServiceMachine
-                }
-              </call>
+              <if expr="STAXResult != ''">
+                <sequence>
+                  <!--- Install DS Copy zip file -->
+                  <message>
+                    'Copy DS zip archive locally to %s.' % TMPDIR
+                  </message>
+                  <call function="'copyFile'">
+                    { 
+                    'srcfile'    : '%s/%s' % (ZIPPATH, ZIPNAME),
+                    'destfile'   : '%s/%s' % (TMPDIR, ZIPNAME),
+                    'remotehost' : STAXServiceMachine
+                    }
+                  </call>
+                  
+                  <!--- Install DS Extract zip file -->
+                  <message>
+                    'Extract locally DS zip archive to %s' % TMPDIR
+                  </message>
+                  <call function="'unZipFile'">
+                    { 
+                    'location' : STAXServiceMachine,
+                    'zipfile'  : '%s/%s' % (TMPDIR, ZIPNAME),
+                    'unzipdir' : TMPDIR
+                    }
+                  </call>
+                  
+                  <call function="'ResolveVar'" >
+                    { 
+                    'location' : STAXServiceMachine,
+                    'type'     : 'STRING',
+                    'name'     : 'STAF/Env/LD_LIBRARY_PATH'
+                    }
+                  </call>                                                       
+                  <script>jstaf_jarfile = '%s/JSTAF.jar' % STAFResult</script> 
+                  
+                  <!---   Compile snmp java files on controler host -->
+                  <message>
+                    'Compile Java files under %s on %s' \
+                    % (javaLocalDir, STAXServiceMachine)
+                  </message>
+                  <call function="'compileJava'" >
+                    {
+                    'location'   : STAXServiceMachine,
+                    'foldername' : javaLocalDir,
+                    'classpath'  : '%s:%s:%s' \
+                    % (SNMP_OPENDS_JARFILE, SNMP_OPENDMK_JARFILE, jstaf_jarfile)
+                    }
+                  </call>
+                  
+                  <!--  Delete the DS zip archive -->
+                  <message>
+                    'Delete %s/%s' % (TMPDIR, ZIPNAME)
+                  </message>
+                  <call function="'deleteFile'">
+                    { 
+                    'location' : STAXServiceMachine,
+                    'filename' : '%s/%s' % (TMPDIR, ZIPNAME)
+                    }
+                  </call>
+                  
+                  <!--  Delete the DS install dir -->
+                  <message>
+                    'Delete %s/%s' % (TMPDIR, OPENDSNAME)
+                  </message>
+                  <call function="'deleteFolder'">
+                    { 
+                    'location' : STAXServiceMachine,
+                    'foldername' : '%s/%s' % (TMPDIR, OPENDSNAME)
+                    }
+                  </call>
+                  
+                  <!-- Archive SNMP_OPENDMK_JARFILE file -->
+                  <message>
+                    'Copy OpenDMK jar file %s locally to %s.' \
+                    % (SNMP_OPENDMK_JARFILE,javaLocalDir)
+                  </message>
+                  <call function="'copyFile'">
+                    { 
+                    'remotehost' : STAXServiceMachine,
+                    'srcfile'    : SNMP_OPENDMK_JARFILE,
+                    'destfile'   : '%s/jdmkrt.jar' % javaLocalDir,
+                    'remotehost' : STAXServiceMachine
+                    }
+                  </call>
+                </sequence>
+              </if>
             </sequence>
-          </if>
+          </if>          
           
           <!--  Delete the any existing testdata archive -->
           <message>

--
Gitblit v1.10.0