Package Install Testing

Version 38 (Mark Donohoe, 03/29/2012 05:49 pm)

1 1 Mark Donohoe
h1. Package Install Testing
2 1 Mark Donohoe
3 34 Mary Laser
*Note: package creation is documented [[FOSSology_Packages|here]]*
4 34 Mary Laser
5 24 Mark Donohoe
Package install testing will use virtual machines along with vm templates and snapshots to accomplish the testing in a quick an timely manner.  Snapshots will allow the restore of the system to it's pre-installed state.  This will enable quick turnaround for testing.
6 24 Mark Donohoe
7 1 Mark Donohoe
Below is the list of VM systems that will be used to test 2.0 package testing:
8 1 Mark Donohoe
9 27 Mark Donohoe
# fed15-32.ostt
10 27 Mark Donohoe
# fed15-64.ostt
11 32 Mark Donohoe
# u1043-32.ostt
12 32 Mark Donohoe
# u1043-64.ostt
13 27 Mark Donohoe
# rhel6-132.ostt
14 27 Mark Donohoe
# rhel6-164.ostt
15 27 Mark Donohoe
# u1104-32.ostt
16 27 Mark Donohoe
# u1104-64.ostt
17 27 Mark Donohoe
# ubun111032.ostt
18 27 Mark Donohoe
# ubun111064.ostt
19 27 Mark Donohoe
# squeze64.ostt
20 10 Mark Donohoe
21 24 Mark Donohoe
h2. VM Creation
22 1 Mark Donohoe
23 29 Mark Donohoe
# Use the vm client software (vSphere) to create each vm.  For each vm, load the following additional software:
24 1 Mark Donohoe
25 24 Mark Donohoe
* Jenkins
26 24 Mark Donohoe
* php (including posix features)
27 30 Mark Donohoe
* subversion
28 24 Mark Donohoe
* java2-runtime (sun version)
29 35 Mark Donohoe
* build-essential
30 36 Mark Donohoe
* phpUnit "Installing phpUnit":http://www.phpunit.de/manual/current/en/installation.html
31 37 Mark Donohoe
* cunit
32 37 Mark Donohoe
<pre>
33 37 Mark Donohoe
   sudo apt-get install libcunit1 libcunit1-doc libcunit1-dev
34 37 Mark Donohoe
</pre>
35 38 Mark Donohoe
* libpcre3 and libpcre3-dev
36 38 Mark Donohoe
<pre>
37 38 Mark Donohoe
  sudo apt-get install libpcre3 libpcre3-dev
38 38 Mark Donohoe
</pre>
39 24 Mark Donohoe
* others per distro (see below)
40 1 Mark Donohoe
41 29 Mark Donohoe
# After each vm is installed, it is cloned as a template so that full recovery is faster. 
42 29 Mark Donohoe
#  As part of the initial set up, there should already be an existing vm. If needed, convert the template into a VM, see the page [[Converting a VM template to an Install VM]]. 
43 29 Mark Donohoe
# After the vm is working and on the network, take a snapshot (with memory) of it using the vm client software.  Take only 1 snapshot.  For example, the rhel6-132.ostt vm was snapshoted as rhel6.1-32-snap1, with description of "rhel6-132.ostt ready for install test".  In the description always use the real full name.
44 29 Mark Donohoe
# After the snapshot is saved (it can take a while), enable it with the snapshot manager.  This is an important step.  If this step is not done, after an install a 'revert' will not be to be done and the vm will have to be removed and recreated.
45 24 Mark Donohoe
46 29 Mark Donohoe
*todo* need a section on snapshots.
47 4 Mark Donohoe
48 29 Mark Donohoe
h2. Setting up a Jenkins slave node (the vm)
49 4 Mark Donohoe
50 33 Mark Donohoe
h3. Debian/Ubuntu
51 1 Mark Donohoe
52 1 Mark Donohoe
* install java2-runtime (sun version)
53 4 Mark Donohoe
* install deamon
54 5 Mark Donohoe
<pre>
55 1 Mark Donohoe
sudo apt-get install openjdk-6-jre openjdk-6-jre-headless daemon 
56 5 Mark Donohoe
</pre>
57 29 Mark Donohoe
* download and install "Jenkins":http://jenkins-ci.org/, use the right bar to select the version, we have used the LTS releases with good results.
58 26 Mark Donohoe
59 29 Mark Donohoe
* Stop Jenkins and reset jenkins user password to _jenkins_.
60 1 Mark Donohoe
* restart jenkins <pre>sudo /etc/init.d/jenkins start</pre>
61 33 Mark Donohoe
* change root passwd to the standard.  Ubuntu systems set it so it must be changed.
62 29 Mark Donohoe
63 20 Mark Donohoe
64 11 Mark Donohoe
h3. RedHat/Fedora/CentOS based systems
65 30 Mark Donohoe
66 30 Mark Donohoe
For all rhel systems, a proxy must be set so yum can reach the outside world.  Modify /etc/yum.conf.
67 30 Mark Donohoe
<pre>proxy=http://lart.usa.hp.com:3128</pre>
68 30 Mark Donohoe
69 30 Mark Donohoe
h4. Fedora
70 30 Mark Donohoe
71 30 Mark Donohoe
Fedora is the easiest of the rhel based systems.  It contains the material needed above without having to go to other repos (except jenkins).
72 30 Mark Donohoe
73 30 Mark Donohoe
* add a proxy to yum (see above)
74 30 Mark Donohoe
* install material:<pre> yum install php php-process emacs subversion</pre>
75 30 Mark Donohoe
76 30 Mark Donohoe
h4. Fedora, RedHat/Centos systems:
77 1 Mark Donohoe
78 1 Mark Donohoe
* download jenkins and get the rpm version we want:
79 1 Mark Donohoe
<pre>wget  http://mirrors.jenkins-ci.org/redhat-stable-rc/jenkins-1.424.2.SNAPSHOT-1.1.noarch.rpm</pre>
80 1 Mark Donohoe
81 1 Mark Donohoe
* install it: <pre>rpm -ivh jenkins-1.424.2.SNAPSHOT-1.1.noarch.rpm</pre>
82 1 Mark Donohoe
* change jenkins to have a login: vipw /etc/passwd, change /bin/false to /bin/bash
83 1 Mark Donohoe
* change jenkins user password to 'jenkins'.
84 1 Mark Donohoe
* put jekins in sudo file (/etc/sudoers) <pre>jenkins ALL=NOPASSWD: ALL</pre>
85 1 Mark Donohoe
* remove jenkins.repo in /etc/yum.repos.d/, if this is not done, the yum update will fail because we don't have the repo key.  Plus we don't want the latest and greatest jenkins.
86 31 Mark Donohoe
* RetroFit RedHat repos
87 31 Mark Donohoe
** For redhat systems, go to the linux coe page and create a retrofit program and run it on the system to enable the repos needed.
88 31 Mark Donohoe
** if not in any repos configured, get the php-process from centos:
89 31 Mark Donohoe
  32 bit: http://mirror.centos.org/centos/6/os/i386/Packages/php-process-5.3.3-3.el6_1.3.i686.rpm
90 31 Mark Donohoe
  64 bit: http://mirror.centos.org/centos/6/os/x86_64/Packages/php-process-5.3.3-3.el6_1.3.x86_64.rpm
91 31 Mark Donohoe
  This is needed as it has posix routines we need for php. This may complain about not having a RSA/SHA1 signature key.
92 31 Mark Donohoe
** for 1.4.1 p7zip-plugins was also needed. 
93 31 Mark Donohoe
    32 bit: ftp://rpmfind.net/linux/fedora/linux/development/rawhide/i386/os/Packages/p7zip-plugins-9.20.1-2.fc16.i686.rpm
94 31 Mark Donohoe
    64 bit: ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/epel/6/x86_64/p7zip-plugins-9.20.1-2.el6.x86_64.rpm
95 31 Mark Donohoe
** install php: yum install php
96 31 Mark Donohoe
** install posix support for php: <pre>yum install php-process or rpm -ivh correct-rpm file for system</pre>
97 16 Mark Donohoe
98 31 Mark Donohoe
* If you can't talk to apache or postgres over the network: Add this to /etc/sysconfig/iptables: <pre>-A INPUT -p tcp -m tcp --sport 80 -j ACCEPT
99 8 Mark Donohoe
-A OUTPUT -p tcp -m tcp --dport 80 -j ACCEPT
100 8 Mark Donohoe
-A INPUT -p tcp --dport 5432 -j ACCEPT</pre>
101 8 Mark Donohoe
102 7 Mark Donohoe
The above will enable apache and postgres
103 7 Mark Donohoe
104 1 Mark Donohoe
now as jenkins sudo <pre>/etc/init.d/postgresql start</pre> works.