From 9dde9d2af6504fa06e7a2d4fb43549a74dd5e868 Mon Sep 17 00:00:00 2001
From: ugaston <ugaston@localhost>
Date: Tue, 10 Jul 2007 20:50:17 +0000
Subject: [PATCH] New basic replication testcases + new shared functions library (tools.xml)

---
 opends/tests/functional-tests/shared/python/replication.py |   55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 54 insertions(+), 1 deletions(-)

diff --git a/opends/tests/functional-tests/shared/python/replication.py b/opends/tests/functional-tests/shared/python/replication.py
index af6f6ba..43a18bc 100644
--- a/opends/tests/functional-tests/shared/python/replication.py
+++ b/opends/tests/functional-tests/shared/python/replication.py
@@ -365,7 +365,35 @@
   ldifLines.append('dn: %s' % dn)
   ldifLines.append('changetype: modify')
   ldifLines.append('%s: %s' % (mod_type,attr_type))
-  ldifLines.append('%s: %s' % (attr_type,attr_value))
+  if attr_value != None :  
+    ldifLines.append('%s: %s' % (attr_type,attr_value))
+  
+  
+  # write out the ldif file
+  outfile = open(path,"w")
+          
+  for line in ldifLines:
+    outfile.write("%s\n" % line)
+          
+  outfile.close()  
+  
+
+
+# Define the function that writes a ldif file with the modify to operate
+# on an entry in a given suffix.
+def write_replication_mod_binary_ldif_file(path, dn, mod_type, attr_type, binary_value_path):
+  
+  # open file and read the binary value (which is encoded in base64)
+  binaryValueFile = open(binary_value_path, "r")
+  binaryValue = binaryValueFile.read()
+  binaryValueFile.close()
+
+  ldifLines = []
+
+  ldifLines.append('dn: %s' % dn)
+  ldifLines.append('changetype: modify')
+  ldifLines.append('%s: %s' % (mod_type,attr_type))
+  ldifLines.append('%s:: %s' % (attr_type,binaryValue))
   
   
   # write out the ldif file
@@ -377,3 +405,28 @@
   outfile.close()  
   
   
+
+
+# Define the function that writes a ldif file with the modDN to operate
+# on an entry in a given suffix.
+def write_replication_moddn_ldif_file(path, dn, newrdn, newsuperior, deleteoldrdn):
+  
+  ldifLines = []
+
+  ldifLines.append('dn: %s' % dn)
+  ldifLines.append('changetype: moddn')
+  ldifLines.append('newRDN: %s' % newrdn)
+  ldifLines.append('deleteOldRDN: %s' % deleteoldrdn)  
+  if newsuperior != None:
+    ldifLines.append('newSuperior: %s' % newsuperior)  
+
+  
+  
+  # write out the ldif file
+  outfile = open(path,"w")
+          
+  for line in ldifLines:
+    outfile.write("%s\n" % line)
+          
+  outfile.close()  
+

--
Gitblit v1.10.0