[pkg-kolab] r1438 - pkg-kolab_testsuite

Mathieu Parent sathieu at alioth.debian.org
Sat Nov 28 15:30:43 UTC 2009


Author: sathieu
Date: 2009-11-28 15:30:43 +0000 (Sat, 28 Nov 2009)
New Revision: 1438

Modified:
   pkg-kolab_testsuite/testsuite
Log:
- generic ldap_master_uri() and base_dn()


Modified: pkg-kolab_testsuite/testsuite
===================================================================
--- pkg-kolab_testsuite/testsuite	2009-11-28 14:42:44 UTC (rev 1437)
+++ pkg-kolab_testsuite/testsuite	2009-11-28 15:30:43 UTC (rev 1438)
@@ -226,6 +226,23 @@
     return $info->{'state'};
 }
 
+#-------------------------------------------------------
+sub ldap_master_uri
+{
+    return "ldaps://".domain_name(0).".".conf('dns_domain');
+}
+
+#-------------------------------------------------------
+sub base_dn
+{
+    my $base_dn = "";
+    foreach my $dc ((split(/\./,conf('dns_domain')))) {
+        $base_dn .= "dc=$dc,";
+    }
+    chop $base_dn;
+    return $base_dn;
+}
+
 #=======================================================
 # Test functions
 #-------------------------------------------------------
@@ -610,7 +627,7 @@
             },
         ],
         [
-            qr'Top level DN for Kolab \[dc=local,dc=tld\]: $',
+            qr'Top level DN for Kolab \['.base_dn().'\]: $',
             sub {
                 my $fh = shift;
                 if( $step == 5 ) {
@@ -640,7 +657,7 @@
             sub {
                 my $fh = shift;
                 if( ($step >= 7) and ($step < 7 + conf('slave_count'))) {
-                    $fh->send("kolab_test_slave".($step-6).".".conf('dns_domain')."\n");
+                    $fh->send(domain_name($step-6).".".conf('dns_domain')."\n");
                     $step++;
                     return exp_continue;
                 }
@@ -738,7 +755,7 @@
             sub {
                 my $fh = shift;
                 if( $step == 4 ) {
-                    $fh->send("ldaps://kolab_test_master.".conf('dns_domain')."\n");
+                    $fh->send(ldap_master_uri()."\n");
                     $step++;
                     return exp_continue;
                 } else {
@@ -747,11 +764,11 @@
             },
         ],
         [
-            qr'Base DN of server \[dc=kolab_test_master,dc=local,dc=tld\]: $',
+            qr'Base DN of server \[dc='.domain_name(0).','.base_dn().'\]: $',
             sub {
                 my $fh = shift;
                 if( $step == 5 ) {
-                    $fh->send("dc=local,dc=tld\n");
+                    $fh->send(base_dn()."\n");
                     $step++;
                     return exp_continue;
                 } else {
@@ -773,7 +790,6 @@
             },
         ],
         #Are you sure you want to continue connecting (yes/no)? 
-        #root at kolab_test_master.local.tld's password: 
         [
             qr'Do you want to create a certificate request and sign it \[y\] \(y/n\): $',
             sub {
@@ -787,8 +803,6 @@
                 }
             },
         ],
-        #root at kolab_test_master.local.tld's password: 
-        #root at kolab_test_master.local.tld's password: 
         # >> slave only
         # << common
         [
@@ -832,8 +846,6 @@
         ],
         # >> common
         # << slave only
-        #root at kolab_test_master.local.tld's password: 
-        #root at kolab_test_master.local.tld's password: 
         # >> slave only
     );
     




More information about the pkg-kolab-devel mailing list