[pkg-kolab] r1421 - pkg-kolab_testsuite

Mathieu Parent sathieu at alioth.debian.org
Thu Nov 26 17:46:56 UTC 2009


Author: sathieu
Date: 2009-11-26 17:46:56 +0000 (Thu, 26 Nov 2009)
New Revision: 1421

Modified:
   pkg-kolab_testsuite/testsuite
Log:
Preparing diifenrent kind of install

Modified: pkg-kolab_testsuite/testsuite
===================================================================
--- pkg-kolab_testsuite/testsuite	2009-11-25 22:21:35 UTC (rev 1420)
+++ pkg-kolab_testsuite/testsuite	2009-11-26 17:46:56 UTC (rev 1421)
@@ -88,23 +88,30 @@
 use Sys::Virt;
 
 my %config = (
+    # general
     'verbose' => '',
     'slave_count' => 1,
     'storagepooldir' => '/var/tmp/pkg-kolab_testsuite',
     'user' => $< , # $REAL_USER_ID
     'group' => 'disk',
     
+    # vm
     'vmmemory' => "256Mb",
     'vmsize' => "1Gb",
     'vmswap' => "128Mb",
+    'vm_install_method' => 'debootstrap',
     'vmdist' => 'sid',
     
+    # virt
     'virt_uri' => 'vbox:///session',
     'virt_type' => 'vbox',
     
+    # network
     'bridge' => 'br0',
     'dnsdomain' => 'local.tld',
     
+    # kolab conf
+    'kolab_installation_method' => 'native',
     'kolab_manager_password' => '12345',
     'ca_passphrase' => '12345678',
     
@@ -219,14 +226,18 @@
     my $storagepooldir = $config{'storagepooldir'};
     
     print "* Bootstraping:\n";
-    system("sudo xen-create-image --hostname $domname ".
-        "--ip ".domain_ip($domid, $domname)." ".
-        "--dist $dist --install-method debootstrap ".
-        "--dir '$storagepooldir' ".
-        "--memory $memory --size $size --swap $swap ".
-        "--fs ext3 --image sparse ".
-        "--force ".
-        "--cache --output '$storagepooldir' --no-hosts ");
+    if($config{'vm_install_method'} == 'debootstrap') {
+        system("sudo xen-create-image --hostname $domname ".
+            "--ip ".domain_ip($domid, $domname)." ".
+            "--dist $dist --install-method debootstrap ".
+            "--dir '$storagepooldir' ".
+            "--memory $memory --size $size --swap $swap ".
+            "--fs ext3 --image sparse ".
+            "--force ".
+            "--cache --output '$storagepooldir' --no-hosts ");
+    } else {
+        die 'Unknow vm_install_method: '.$config{'vm_install_method'};
+    }
     system("sudo chown -R ".$config{'user'}.":".$config{'group'}." '$storagepooldir'");
 }
 
@@ -428,16 +439,29 @@
     system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip 'cat <<EOF > /etc/hosts
 $hosts
 EOF'");
-    print "* Updating APT:\n";
-    system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip 'cat <<EOF > /etc/apt/sources.list.d/kolab.list
+    # ====
+    print "* Preparing packages:\n";
+    if($config{'kolab_installation_method'} == 'native') {
+        system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip 'cat <<EOF > /etc/apt/sources.list.d/kolab.list
 #kolab
 deb http://pkg-kolab.alioth.debian.org/packages UNRELEASED/
 EOF'");
-    system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip 'apt-get -qq update'");
-    print "* Following https://wiki.kolab.org/index.php/Debian_-_Administrators_-_Kolab_Installation\n";
-
+        system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip 'apt-get -qq update'");
+        print "* Following https://wiki.kolab.org/index.php/Debian_-_Administrators_-_Kolab_Installation\n";
+    } else {
+        die 'Unknow kolab_installation_method: '.$config{'kolab_installation_method'};
+    }
+    
+    # ====
     print "* Installing:\n";
-    system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip 'DEBIAN_FRONTEND=noninteractive apt-get -y --allow-unauthenticated install kolabd postfix slapd'");
+    if($config{'kolab_installation_method'} == 'native') {
+        system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip 'DEBIAN_FRONTEND=noninteractive apt-get -y --allow-unauthenticated install kolabd postfix slapd'");
+    } else {
+        die 'Unknow kolab_installation_method: '.$config{'kolab_installation_method'};
+    }
+    
+    # ====
+    print "* Stopping services:\n";
     system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip '/etc/init.d/apache2 stop'");
     system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip '/etc/init.d/kolabd stop'");
     system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip '/etc/init.d/kolab-cyrus stop'");
@@ -446,6 +470,7 @@
     system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip '/etc/init.d/slapd stop'");
     system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip '/etc/init.d/amavis stop #optionally'");
 
+    # ====
     print "* Kolab bootstrap:\n";
     my $exp = console_create($domid, $domname);
     $exp->log_file("$domname.log");
@@ -756,13 +781,15 @@
     );
     
     if($domid == 0) {
-        # enable ldaps on master
+        print "* Enabling LDAPS (master):\n";
         system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip ".
             '\'sed -i.bck \\\'s@^SLAPD_SERVICES="ldap:/// ldapi:///"'.
                               '@SLAPD_SERVICES="ldap://127.0.0.1:389/ ldaps:/// ldapi:///"@\\\' '.
                               '/etc/default/slapd\'');
     }
 
+    # ====
+    print "* Starting services:\n";
     system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip '/etc/init.d/amavis start #optionally'");
     system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip '/etc/init.d/slapd start'");
     system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip '/etc/init.d/saslauthd start'");
@@ -771,6 +798,7 @@
     system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip '/etc/init.d/kolabd start'");
     system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip '/etc/init.d/apache2 start'");
 
+    # ====
     print "* Installing PHP Unit:\n";
     system("ssh -i '".$config{'storagepooldir'}."/key' root\@$domip 'apt-get -qy install phpunit'");
 }




More information about the pkg-kolab-devel mailing list