Package Install Testing

Version 42 (Mark Donohoe, 04/10/2012 02:58 am)

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 40 Mark Donohoe
* php (including posix features, and php5-xsl)
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 42 Mark Donohoe
* after the os is installed, make sure to use the vm client software to install the vmtools on the machine (highlight the vm, right click, guest-> install....
33 42 Mark Donohoe
* ??check out 2.0 sources and run fo-installdeps to get all the dependencies needed to run the tests after an install.
34 24 Mark Donohoe
* others per distro (see below)
35 1 Mark Donohoe
36 29 Mark Donohoe
# After each vm is installed, it is cloned as a template so that full recovery is faster. 
37 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]]. 
38 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.
39 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.
40 24 Mark Donohoe
41 29 Mark Donohoe
*todo* need a section on snapshots.
42 4 Mark Donohoe
43 29 Mark Donohoe
h2. Setting up a Jenkins slave node (the vm)
44 4 Mark Donohoe
45 33 Mark Donohoe
h3. Debian/Ubuntu
46 1 Mark Donohoe
47 1 Mark Donohoe
* install java2-runtime (sun version)
48 4 Mark Donohoe
* install deamon
49 5 Mark Donohoe
<pre>
50 1 Mark Donohoe
sudo apt-get install openjdk-6-jre openjdk-6-jre-headless daemon 
51 5 Mark Donohoe
</pre>
52 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.
53 26 Mark Donohoe
54 29 Mark Donohoe
* Stop Jenkins and reset jenkins user password to _jenkins_.
55 41 Mark Donohoe
* put jenkins user in the fossy group (sorta chicken and egg, if fossy group doesn't exist yet).
56 1 Mark Donohoe
* restart jenkins <pre>sudo /etc/init.d/jenkins start</pre>
57 33 Mark Donohoe
* change root passwd to the standard.  Ubuntu systems set it so it must be changed.
58 29 Mark Donohoe
59 20 Mark Donohoe
60 11 Mark Donohoe
h3. RedHat/Fedora/CentOS based systems
61 30 Mark Donohoe
62 30 Mark Donohoe
For all rhel systems, a proxy must be set so yum can reach the outside world.  Modify /etc/yum.conf.
63 30 Mark Donohoe
<pre>proxy=http://lart.usa.hp.com:3128</pre>
64 30 Mark Donohoe
65 30 Mark Donohoe
h4. Fedora
66 30 Mark Donohoe
67 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).
68 30 Mark Donohoe
69 30 Mark Donohoe
* add a proxy to yum (see above)
70 30 Mark Donohoe
* install material:<pre> yum install php php-process emacs subversion</pre>
71 30 Mark Donohoe
72 30 Mark Donohoe
h4. Fedora, RedHat/Centos systems:
73 1 Mark Donohoe
74 1 Mark Donohoe
* download jenkins and get the rpm version we want:
75 1 Mark Donohoe
<pre>wget  http://mirrors.jenkins-ci.org/redhat-stable-rc/jenkins-1.424.2.SNAPSHOT-1.1.noarch.rpm</pre>
76 1 Mark Donohoe
77 1 Mark Donohoe
* install it: <pre>rpm -ivh jenkins-1.424.2.SNAPSHOT-1.1.noarch.rpm</pre>
78 1 Mark Donohoe
* change jenkins to have a login: vipw /etc/passwd, change /bin/false to /bin/bash
79 1 Mark Donohoe
* change jenkins user password to 'jenkins'.
80 1 Mark Donohoe
* put jekins in sudo file (/etc/sudoers) <pre>jenkins ALL=NOPASSWD: ALL</pre>
81 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.
82 31 Mark Donohoe
* RetroFit RedHat repos
83 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.
84 31 Mark Donohoe
** if not in any repos configured, get the php-process from centos:
85 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
86 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
87 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.
88 31 Mark Donohoe
** for 1.4.1 p7zip-plugins was also needed. 
89 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
90 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
91 31 Mark Donohoe
** install php: yum install php
92 31 Mark Donohoe
** install posix support for php: <pre>yum install php-process or rpm -ivh correct-rpm file for system</pre>
93 16 Mark Donohoe
94 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
95 8 Mark Donohoe
-A OUTPUT -p tcp -m tcp --dport 80 -j ACCEPT
96 8 Mark Donohoe
-A INPUT -p tcp --dport 5432 -j ACCEPT</pre>
97 8 Mark Donohoe
98 7 Mark Donohoe
The above will enable apache and postgres
99 7 Mark Donohoe
100 1 Mark Donohoe
now as jenkins sudo <pre>/etc/init.d/postgresql start</pre> works.