[Lsb-messages] /var/www/bzr/lsb/devel/puppet-lsb r88: Add slavescripts from buildbot-config.

Jeff Licquia licquia at linuxfoundation.org
Sat Jan 28 15:43:16 UTC 2012


------------------------------------------------------------
revno: 88
committer: Jeff Licquia <licquia at linuxfoundation.org>
branch nick: puppet-lsb
timestamp: Sat 2012-01-28 10:43:16 -0500
message:
  Add slavescripts from buildbot-config.
added:
  modules/buildbot/files/slavescripts/
  modules/buildbot/files/slavescripts/reset-sdk
  modules/buildbot/files/slavescripts/run-appbat-tests
  modules/buildbot/files/slavescripts/update-sdk
modified:
  modules/buildbot/manifests/slave.pp
-------------- next part --------------
=== added directory 'modules/buildbot/files/slavescripts'
=== added file 'modules/buildbot/files/slavescripts/reset-sdk'
--- a/modules/buildbot/files/slavescripts/reset-sdk	1970-01-01 00:00:00 +0000
+++ b/modules/buildbot/files/slavescripts/reset-sdk	2012-01-28 15:43:16 +0000
@@ -0,0 +1,43 @@
+#!/bin/sh -e
+
+if [ "$1" = "--beta" ]; then
+    SDK_TYPE=beta
+else
+    SDK_TYPE=released
+fi
+
+if [ -e /tmp/last_installed_sdk ]; then
+    if [ $(cat /tmp/last_installed_sdk) = "$SDK_TYPE" ]; then
+	echo "$SDK_TYPE SDK already installed"
+	exit 0
+    fi
+fi
+
+rm -f /tmp/last_installed_sdk
+
+mkdir -p $HOME/tmp
+[ -e $HOME/lsb-$SDK_TYPE-sdk.tar.gz ]
+
+# SDK packages besides lsb-build-base, which has to be handled specially.
+SDK_PKGS="lsb-build-cc lsb-build-c++ lsb-build-desktop lsb-build-qt3 lsb-build-qt4 lsb-makelsbpkg"
+
+for pkg in $SDK_PKGS; do
+  sudo rpm --nodeps --allmatches -e $pkg || true
+done
+sudo rpm --nodeps --allmatches -e lsb-build-libbat || true
+sudo rpm --nodeps --allmatches -e lsb-build-base || true
+
+(cd $HOME/tmp && zcat $HOME/lsb-$SDK_TYPE-sdk.tar.gz | tar xf -)
+
+rpm -q lsb-setup > /dev/null 2>&1
+if [ $? -ne 0 ]; then
+  sudo rpm -Uvh --force $HOME/tmp/lsb-sdk/lsb-setup*rpm
+fi
+
+sudo rpm -Uvh --force $HOME/tmp/lsb-sdk/lsb-build-base*
+for pkg in $SDK_PKGS; do
+  sudo rpm -Uvh --force $HOME/tmp/lsb-sdk/$pkg*
+done
+
+rm -rf $HOME/tmp/lsb-sdk
+echo $SDK_TYPE > /tmp/last_installed_sdk

=== added file 'modules/buildbot/files/slavescripts/run-appbat-tests'
--- a/modules/buildbot/files/slavescripts/run-appbat-tests	1970-01-01 00:00:00 +0000
+++ b/modules/buildbot/files/slavescripts/run-appbat-tests	2012-01-28 15:43:16 +0000
@@ -0,0 +1,107 @@
+#!/usr/bin/python
+
+# run-appbat-tests - script to run tests on the appbat
+
+# This script expects to be called from the build root, and takes
+# two command-line arguments: the directory containing the packages,
+# and the directory to place the results.
+
+import sys
+import os
+import subprocess
+
+# For appchk, which specific app do we wish to test?
+
+project_exe = { "alsaplayer": "bin/alsaplayer",
+                "apache": "sbin/httpd",
+                "rsync": "bin/rsync",
+                "samba": "sbin/smbd",
+                "tcl": "bin/tclsh8.5",
+                "expect": "bin/expect",
+                "python": "bin/python",
+                "groff": "bin/groff",
+                "lynx": "bin/lynx",
+                "xpdf": "bin/xpdf",
+                "ghostscript": "bin/gs",
+                "gnupg": "bin/gpg",
+                "openjade": "bin/openjade",
+                "perl": "bin/perl",
+                "raptor": "bin/rapper",
+                "pidgin": "bin/pidgin",
+                "leafpad": "bin/leafpad",
+                "celestia": "bin/celestia",
+                "xpaint": "bin/xpaint",
+                "scribus": "bin/scribus",
+                "designer": "bin/designer",
+                "transmission": "bin/transmission",
+                "xscreensaver": "bin/xscreensaver " }
+
+# What archs use "lib64" instead of "lib"?
+
+lib64_archs = ["ppc64", "s390x", "x86_64"]
+
+def run_appchk(resultdir):
+    # Get proper lib dir.
+
+    arch_process = subprocess.Popen("arch", stdout=subprocess.PIPE)
+    arch_process.wait()
+    arch_name = arch_process.stdout.read().strip()
+
+    if arch_name in lib64_archs:
+        libdir = "lib64"
+    else:
+        libdir = "lib"
+
+    # Run appchk.
+
+    for pkgrootdir in os.listdir("pkgroot"):
+        prjname = os.path.basename(pkgrootdir).replace("lsb-", "")
+        if prjname in project_exe:
+            appchk_out = open(
+                os.path.join(resultdir, "lsb-%s.output" % prjname), "w")
+            appchk_journalpath = \
+                os.path.join(resultdir, "journal.appchk.%s" % prjname)
+            appchk_exe = os.path.join("pkgroot", pkgrootdir, 
+                                      "opt", "lsb", "appbat", 
+                                      project_exe[prjname])
+            appchk_cmdline = \
+                "/opt/lsb/bin/lsbappchk -j -o %s -D pkgroot/%s/opt/lsb/appbat/%s %s" % \
+                (appchk_journalpath, pkgrootdir, libdir, appchk_exe)
+
+            appchk_process = subprocess.Popen(appchk_cmdline, shell=True, 
+                                              stdout=appchk_out, 
+                                              stderr=subprocess.STDOUT)
+            appchk_process.wait()
+            appchk_out.close()
+
+            if appchk_process.returncode != 0:
+                sys.stdout.write("appchk failed on %s\n" % prjname)
+            else:
+                tjreport_out = open(
+                    os.path.join(resultdir, "tjreport.%s.txt" % prjname), "w")
+                subprocess.call(
+                    "/opt/lsb-tet3-lite/bin/tjreport %s" % appchk_journalpath,
+                    stdout=tjreport_out, stderr=subprocess.STDOUT, shell=True)
+                tjreport_out.close()
+
+def run_pkgchk(pkgdir, resultdir):
+    for pkg in os.listdir(pkgdir):
+        if pkg[-4:] != ".rpm":
+            continue
+
+        pkgchk_journalpath = os.path.join(resultdir, 
+                                          "journal.pkgchk.%s.txt" % pkg)
+        pkgchk_cmdline = "/opt/lsb/bin/lsbpkgchk -r 4.0 -Llsb -j %s %s" % \
+            (pkgchk_journalpath, os.path.join(pkgdir, pkg))
+        subprocess.call(pkgchk_cmdline, shell=True)
+
+def main():
+    (pkgdir, resultdir) = sys.argv[1:]
+    if not os.path.exists(resultdir):
+        os.makedirs(resultdir)
+
+    run_appchk(resultdir)
+    run_pkgchk(pkgdir, resultdir)
+
+if __name__ == "__main__":
+    main()

=== added file 'modules/buildbot/files/slavescripts/update-sdk'
--- a/modules/buildbot/files/slavescripts/update-sdk	1970-01-01 00:00:00 +0000
+++ b/modules/buildbot/files/slavescripts/update-sdk	2012-01-28 15:43:16 +0000
@@ -0,0 +1,17 @@
+#!/bin/sh -e
+
+if [ -e /tmp/last_installed_sdk ]; then
+    if [ $(cat /tmp/last_installed_sdk) = "devel" ]; then
+	echo "devel SDK already installed"
+	exit 0
+    fi
+fi
+
+rm -f /tmp/last_installed_sdk
+
+PKG_DIR=$1
+
+find $PKG_DIR -name \*.rpm -print | grep -v src.rpm | \
+  xargs sudo rpm -Uvh --force
+
+echo "devel" > /tmp/last_installed_sdk

=== modified file 'modules/buildbot/manifests/slave.pp'
--- a/modules/buildbot/manifests/slave.pp	2012-01-28 01:22:41 +0000
+++ b/modules/buildbot/manifests/slave.pp	2012-01-28 15:43:16 +0000
@@ -8,4 +8,19 @@
         require => Exec["make-buildbot-virtualenv"],
     }
 
+    file { "/usr/local/bin/reset-sdk":
+        source => "puppet:///modules/buildbot/slavescripts/reset-sdk",
+        mode   => 0755,
+    }
+
+    file { "/usr/local/bin/update-sdk":
+        source => "puppet:///modules/buildbot/slavescripts/update-sdk",
+        mode   => 0755,
+    }
+
+    file { "/usr/local/bin/run-appbat-tests":
+        source => "puppet:///modules/buildbot/slavescripts/run-appbat-tests",
+        mode   => 0755,
+    }
+
 }



More information about the lsb-messages mailing list