Changeset 1565


Ignore:
Timestamp:
May 23, 2012, 2:49:01 AM (7 years ago)
Author:
bruno
Message:
  • Develop more the test script. Only VM and RM tests to be considered
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/t/pbtest

    r1564 r1565  
    1212
    1313# You may have multiple distros here
    14 TESTVEDIST="fedora-16-x86_64 mageia-1-i386"
     14TESTVEDIST="fedora-16-x86_64 mageia-1-i386 debian-6.0-x86_64 ubuntu-11.04-i386"
    1515# Only one VM is tested for now.
    1616TESTVMDIST="fedora-16-i386"
    1717TESTVMISO="/users/bruno/iso/Fedora-16-i386-DVD.iso"
    1818
     19grep -q pbtest /etc/passwd
     20if [ $? -ne 0 ]; then
     21    rm -rf ~pbtest/* ~pbtest/.??*
     22fi
     23sudo groupdel pbtest
    1924sudo userdel pbtest
    2025sudo useradd pbtest
    21 sudo cat > pbtest/.pbrc << EOF
     26grep -q pbtest /etc/sudoers
     27if [ $? -ne 0 ]; then
     28    sudo cat >> /etc/sudoers << EOF
    2229pbtest localhost=/usr/sbin/chroot NOPASSWD:
    2330pbtest localhost=/bin/cp NOPASSWD:
    2431EOF
    25 
     32fi
     33
     34#Taken from Lab document originally
     35# SVN repo setup
     36sudo su - pbtest -c "mkdir -p prj ; svnadmin create prj/svn"
     37sudo cat >> ~pbtest/prj/svn/conf/authz << EOF
     38[/]
     39pbtest = rw
     40* = r
     41EOF
     42sudo cat >> ~pbtest/prj/svn/conf/passwd << EOF
     43pbtest = pbtest
     44EOF
     45sudo cat > ~pbtest/prj/svn/conf/svnserve.conf << EOF
     46[general]
     47password-db = passwd
     48authz-db = authz
     49[sasl]
     50EOF
     51sudo chown pbtest:pbtest ~pbtest/prj/svn/conf/authz ~pbtest/prj/svn/conf/passwd ~pbtest/prj/svn/conf/svnserve.conf
     52sudo su - pbtest -c "svnserve -d -r ~pbtest/prj/svn"
     53sudo su - pbtest -c "mkdir pb ftp ve .ssh; chmod 700 .ssh"
     54
     55sudo su - pbtest -c "pb --version"
     56sudo su - pbtest -c "pbdistrocheck"
     57sudo su - pbtest -c "pb clean"
     58sudo cat > ~pbtest/.pbrc << EOF
    2659# Projects
    27 pbconfurl afio = svn+ssh://svn.project-builder.org/prj/svn/pb/projects/afio/pbconf
     60pbconfurl afio = svn://localhost/pb/afio/pbconf
     61pbdefdir default = $ENV{'HOME'}/pb
    2862pbconfurl projtest = dir://$ENV{'HOME'}/projtest
    2963pbconfdir projtest = $ENV{'HOME'}/projtest/pbconf
     
    3266pbconfdir pb = $ENV{'HOME'}/pb/pbconf
    3367pburl pb = svn+ssh://svn.project-builder.org/prj/svn/pb
    34 pbdefdir default = $ENV{'HOME'}
    35 #
     68pburl mondorescue = svn://svn.mondorescue.org/mondorescue/branches
     69#
     70pbpackager default = Big Chief <bigchief@hp.com>
    3671vmport pb = 2200
    3772pbparallel pb = 6
    38 vepath pb = $ENV{'HOME'}/tmp
    39 vetype pb = chroot
    40 verpmtype pb = rpmbootstrap
    41 vmtype pb = kvm
    42 vmcmd pb = qemu-kvm
    43 vmpath pb = $ENV{'HOME'}/tmp
     73vepath default = $ENV{'HOME'}/ve
     74vmtype default = kvm
     75vmcmd default = qemu-kvm
     76vmpath default = $ENV{'HOME'}/tmp
    4477vmsize fedora = 10G
    45 vmmonport pb = 4000
    46 EOF
    47 
     78vmmonport default = 4000
     79EOF
     80
     81sudo cat > ~pbtest/ve/.pbrc << EOF
     82vetype default = chroot
     83verpmtype default = rpmbootstrap
     84vedebtype default = debootstrap
     85verebuild default = false
     86veopt default =
     87vesnap default = false
     88velogin default = pbtest
     89EOF
     90echo "velist default = `echo $TESTVEDIST | sed 's/ */,/g'`" >> ~pbtest/ve/.pbrc
     91
     92sudo chown pbtest:pbtest ~pbtest/.pbrc
     93sudo su - pbtest -c "ssh-keygen -f .ssh/id_rsa -t rsa -b 768 -v -N ''"
     94sudo su - pbtest -c "cp .ssh/id_rsa.pub .ssh/authorized_keys ; chmod 600 .ssh/authorized_keys"
     95sudo su - pbtest -c "ssh -i .ssh/id_rsa.pub localhost touch ftp/README"
     96sudo su - pbtest -c "svn import pb svn://localhost/pb -m 'Initial creation of pb repo'"
     97sudo su - pbtest -c "cd pb ; svn co svn://localhost/pb ."
     98sudo su - pbtest -c "pb -p afio newproj afio"
     99sudo cat >> ~pbtest/pb/afio/pbconf/afio.pb << EOF
     100defpkgdir afio = dummy
     101projver afio = 2.5
     102projtag afio = 1
     103pburl afio = ftp://ftp.project-builder.org/src/afio-2.5.tar.gz
     104pbrepo afio = ftp://ftp.project-builder.org
     105sshhost afio = localhost
     106sshlogin afio = pbtest
     107sshdir afio = $ENV{'HOME'}/ftp
     108EOF
     109sudo su - pbtest -c "pb -p afio sbx2build"
     110
     111sudo cat >> ~pbtest/pb/afio/pbconf/pbfilter/all.pbf << EOF
     112filter PBSRC = src/%{name}-%{version}.tar.gz
     113filter PBDESC = afio is a cpio compatible archiver with extended features$/It can compress on a file by file basis.
     114filter PBSUMMARY = afio is a cpio compatible archiver with extended features
     115filter PBURL = http://www.boutell.com/lsm/lsmbyid.cgi/000462
     116filter PBLOG = no
     117EOF
     118sudo cat >> ~pbtest/pb/afio/pbconf/pbfilter/rpm.pbf << EOF
     119filter PBGRP = Applications/Archiving
     120filter PBLIC = Afio
     121EOF
     122sudo su - pbtest -c "pb -p afio sbx2build"
     123
     124sudo perl -pi -e 's|%configure||' ~pbtest/pb/afio/pbconf/afio/rpm/afio.spec
     125sudo perl -pi -e 's|make %{?_smp_mflags}|make %{?_smp_mflags}\nchmod 644 script*/*|' ~pbtest/pb/afio/pbconf/afio/rpm/afio.spec
     126sudo perl -pi -e 's|make DESTDIR=$RPM_BUILD_ROOT install|kdir -p $RPM_BUILD_ROOT%{_bindir}\nmkdir -p $RPM_BUILD_ROOT%{_mandir}/man1\ninstall -p -m 755 afio $RPM_BUILD_ROOT%{_bindir}\ninstall -p -m 644 afio.1 $RPM_BUILD_ROOT%{_mandir}/man1|' ~pbtest/pb/afio/pbconf/afio/rpm/afio.spec
     127sudo perl -pi -e 's|%doc ChangeLog|%doc HISTORY PORTING README SCRIPTS ANNOUNCE-2.5 perl.artistic.license|' ~pbtest/pb/afio/pbconf/afio/rpm/afio.spec
     128sudo perl -pi -e 's|%doc INSTALL COPYING README AUTHORS NEWS|%doc afio.lsm script1 script2 script3 script4\n%{_bindir}/%{name}\n%{_mandir}/man1/%{name}.1*|' ~pbtest/pb/afio/pbconf/afio/rpm/afio.spec
    48129sudo su - pbtest -c "pb -p afio sbx2pkg"
     130rpm -qilvp ~pbtest/pb/afio/build/RPMS/x86_64/afio-2.5*
     131
    49132sudo su - pbtest -c "pb -p pb sbx2pkg"
    50 
    51 sudo su - pbtest -c "pb -p projtest getconf"
    52 sudo su - pbtest -c "pb -p projtest -r 1.0 newproj prokpkg"
    53 sudo su - pbtest -c "pb -p projtest -r 1.0 sbx2build"
    54 sudo su - pbtest -c "pb -p projtest build2pkg"
     133sudo su - pbtest -c "pb -p pb build2ssh"
     134sudo su - pbtest -c "pb -p pb pkg2ssh"
     135
     136sudo cat >> ~pbtest/pb/afio/pbconf/afio/pbcl << EOF
     137# $Id$
     138
     139AFIO CHANGES
     140
     1412.5 (2009-12-03)
     142- First packages created
     143EOF
     144svn add ~pbtest/pb/afio/pbconf/afio/pbcl
     145svn ci -m 'Adding pbcl for afio'
     146
     147sudo perl -pi -e 's|,\s*PBDEP||' ~pbtest/pb/afio/pbconf/afio/deb/control
     148sudo perl -pi -e 's|Recommends: PBREC||' ~pbtest/pb/afio/pbconf/afio/deb/control
     149sudo perl -pi -e 's|Suggests: PBSUG||' ~pbtest/pb/afio/pbconf/afio/deb/control
     150sudo cat > ~pbtest/pb/afio/pbconf/afio/deb/afio.docs << EOF
     151HISTORY
     152PORTING
     153README
     154SCRIPTS
     155ANNOUNCE-2.5
     156perl.artistic.license
     157afio.lsm
     158script1
     159script2
     160script3
     161script4
     162EOF
     163sudo perl -pi -e 's|config.status: configure|config.status: Makefile|' ~pbtest/pb/afio/pbconf/afio/deb/rules
     164sudo perl -pi -e 's|dh_installchangelogs ChangeLog|dh_installchangelogs debian/changelog|' ~pbtest/pb/afio/pbconf/afio/deb/rules
     165sudo perl -pi -e 's|$(MAKE) install|mkdir -p $(CURDIR)/debian/$(PACKAGE_NAME)/usr/bin $(CURDIR)/debian/$(PACKAGE_NAME)/usr/share/man/man1|' ~pbtest/pb/afio/pbconf/afio/deb/rules
     166sudo perl -pi -e 's|# - copy html manual to temporary location for renaming|install -p -m 755 afio $(CURDIR)/debian/$(PACKAGE_NAME)/usr/bin ; nstall -p -m 644 afio.1 $(CURDIR)/debian/$(PACKAGE_NAME)/usr/share/man/man1|' ~pbtest/pb/afio/pbconf/afio/deb/rules
     167sudo sed -i -e '/\.\/configure /d' ~pbtest/pb/afio/pbconf/afio/deb/rules
     168
     169#dpkg -I ~ftp/pub/afio/test/debian/5.0/afio_2.5-0.20091204131057_i386.deb
     170#dpkg -x ~ftp/pub/afio/test/debian/5.0/afio_2.5-0.20091204131057_i386.deb /tmp/x ;  ls -lR /tmp/x
     171
     172sudo su - pbtest -c "pb -p afio getconf"
    55173
    56174for d in $TESTVEDIST; do
    57     sudo su - pbtest -c "pb -p projtest -m $d newve"
    58     sudo su - pbtest -c "pb -p projtest -m $d sbx2setupve"
    59     sudo su - pbtest -c "pb -p projtest -m $d snapve"
    60     sudo su - pbtest -c "pb -p projtest -m $d build2ve"
     175    sudo su - pbtest -c "pb -p afio -m $d newve"
     176    sudo su - pbtest -c "pb -p pb -m $d sbx2setupve"
     177    sudo su - pbtest -c "pb -p afio -m $d snapve"
     178    sudo su - pbtest -c "pb -p afio -m $d sbx2ve"
    61179    # Cleaning VE to use the snapshot
    62180    dd=`echo $d | cut -d'-' -f1`
    63181    sudo rm -rf ~pbtest/tmp/$dd
    64     sudo su - pbtest -c "pb -p projtest -S -m $d sbx2ve"
     182    sudo su - pbtest -c "pb -p afio -S -m $d sbx2ve"
    65183done
     184
     185# test also with MOndoRescue
     186pb -p mondorescue -r branches/3.0 cms2pkg
    66187
    67188#qemu-kvm \
     
    76197#sudo su - pbtest -c "pb -p projtest -m $TESTVMDIST sbx2vm"
    77198
    78 sudo su - pbtest -c "pb -p projtest -r 1.0 -V 2.0 newver"
    79 sudo su - pbtest -c "pb -p projtest clean"
     199sudo su - pbtest -c "pb -p afio -r 1.0 -V 2.0 newver"
     200sudo su - pbtest -c "pb -p afio clean"
    80201
    81202# Cleanup
    82 sudo userdel pbtest
     203#sudo userdel pbtest
Note: See TracChangeset for help on using the changeset viewer.