cfd9d2e766fd97bcd446bbc77b286d9f44778b9d
[devwiki.git] / release / test.mdwn
1 [[!meta title="Preparing Test Builds"]]
2
3 This page describes performing test builds to run on Painless
4 Security's test infrastructure.
5
6 Log into moonbuild (10.1.10.11) and check out a tree.  Below we check out a writable tree, because you'll probably end up making some changes:
7
8     ssh -A username@10.1.10.11
9     git clone username@moonshot.suchdamage.org:/srv/git/moonshot.git
10
11 this will leave you on the master branch of the [[Moonshot repository|branches]].
12 However, to build Debian test packages, you want to be  on the debian branch. So:
13
14     cd moonshot
15     git checkout debian
16     git submodule update --init
17
18 Now, merge in the changes you want to test.
19 Let's say that you're updating moonshot itself and that your changes are already on master.
20
21     cd moonshot
22     git merge origin/master
23
24 Now we'll need to update the debian version number so we can do a fresh build:
25
26     dch -i
27
28 This will pull up an editor.  Describe the change.  You will be modifying debian/changelog.  We will not commit this file because we're just generating test packages.
29
30 Change back to the root of your checkout of the master repository.
31
32 Now, we want to disable stripping and optimization for our builds:
33
34     export DEB_BUILD_OPTIONS="noopt nostrip"
35
36 Now would be a good time to remove the "debian_build" directory if it has contents from a previous build.
37
38 And run the builds
39
40     ./debian-builder -s -c -s wheezy-i386 -s --arch=i386 -s -A directories
41 The "-s" option gets repeated a lot because it passes the following option to sbuild, the Debian package build infrastructure.  That will run an i386 (32-bit) build of the software using the wheezy-i386 (Debian 7.0) chroot (filesystem image).  For directories include the directory of the software you're wishing to build.
42
43 The output packages will be placed in the debian_build directory.
44
45 Copy these to any test machines you like.  You might like a loop something like
46
47     for ip in 21 22 23 90; do
48         rsync -e ssh -a debian_build root@10.1.10.$ip:/tmp
49         done
50
51 That will copy the debian_build directory to the listed machines.  Log into these machines and run
52
53     cd /tmp/debian_build
54     dpkg -i packages_you_want_to_install
55
56 If dependencies are not installed try running "aptitude install" to fix.  Make sure it doesn't "fix" things by removing the package you just installed.
57
58 You can run
59
60     git reset --hard
61
62 In the submodule checkout to throw awy your changes if you need to re-merge in some new fixes.