[SCM] debian-live/autotesting branch, master, updated. 7c25c59dad103a42f95d2fc6fb4cb4ce42fa3344

Brendan M. Sleight (none) bms at brum.
Tue May 18 21:56:53 UTC 2010


The following commit has been merged in the master branch:
commit 7c25c59dad103a42f95d2fc6fb4cb4ce42fa3344
Author: Brendan M. Sleight <bms at brum.(none)>
Date:   Tue May 18 22:57:49 2010 +0100

    Adding autobuild script (python not sh for some reason)

diff --git a/Makefile b/Makefile
index 404b62c..ded22b5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-LIST = build-60alpha1-i386-iso-hybrid-xfce-daily.xml build-60alpha1-amd64-iso-hybrid-all-monthly.xml build-60alpha1-powerpc-iso-all-monthly.xml build-60alpha1-i386-iso-hybrid-all-monthly.xml 
+LIST = build-60alpha1-i386-iso-hybrid-lxde-desktop-daily.xml build-60alpha1-amd64-iso-hybrid-all-monthly.xml build-60alpha1-powerpc-iso-all-monthly.xml build-60alpha1-i386-iso-hybrid-all-monthly.xml 
 
 all: install
 
diff --git a/autotesting.py b/autotesting.py
index e3d084f..c1bd9ef 100644
--- a/autotesting.py
+++ b/autotesting.py
@@ -19,7 +19,19 @@
 
 
 from optparse import OptionParser
-import amara, datetime, os, shutil, subprocess, sys, telnetlib, tempfile, time, datetime, urllib, twitter
+import amara, datetime, os, shutil, subprocess, sys, telnetlib, tempfile, time, datetime, urllib, twitter, fcntl
+
+class SingleInstance:
+    # Slimed down from excellent example given at:-
+    # http://stackoverflow.com/questions/380870/python-single-instance-of-program
+    def __init__(self):
+        self.lockfile = os.path.normpath(tempfile.gettempdir() + '/' + os.path.basename(__file__) + '.lock')
+        self.fp = open(self.lockfile, 'w')
+        try:
+            fcntl.lockf(self.fp, fcntl.LOCK_EX | fcntl.LOCK_NB)
+        except IOError:
+            log("Another Autotesting is already running, quitting.")
+            sys.exit(-1)
 
 def displayNumber():
     """Really a global we can change later to something better.
@@ -83,7 +95,7 @@ def wget(url, limit):
     tmpFile = tempfile.NamedTemporaryFile(prefix="autotesting_wget_")
     L = ['wget', '-nv', str(url), '-O', tmpFile.name]
     if limit == True:
-        L.append('--limit-rate=2M')
+        L.append('--limit-rate=1.5M')
     # Maybe do something with the retcode in the future.
     retcode = subprocess.call(L)
     return tmpFile
@@ -209,7 +221,7 @@ def runningQemu(display, test, qemuDownload):
     if not qemuBinary.startswith("qemu"):
         log("WARNING! : " + qemuBinary + " does not start with qemu, using qemu instead.")
         qemuBinary = "qemu"
-    qemuCommand = [qemuBinary, "-monitor", monitor, "-full-screen"]    
+    qemuCommand = [qemuBinary, "-monitor", monitor, "-rtc", "clock=vm", "-full-screen"]    
     for o in str(test.qemu.options).split(' '):
         qemuCommand.append(o)
     qemuCommand.append(str(qemuDownload))
@@ -250,30 +262,27 @@ def createMontage(video, test):
     return fileObject"""
     log("Creating Montage")
     montage = tempfile.NamedTemporaryFile(prefix="autotesting_video_", suffix=".png")
+    tempDir = tempfile.mkdtemp(prefix="autotesting_video_", suffix="_dir")
     videoLength = int(str(test.qemu.pause)) + int(str(test.qemu.time)) 
     # Time for opening titles
     videoLength = videoLength + 2 + 3 + 3 + 2
     listFrames = []
     listFramesNames = []
-    for count in range(16):
-        ss = 0.0625 * count * videoLength
-        frame = tempfile.NamedTemporaryFile(prefix="autotesting_frame_", suffix=".jpg")
-        frameName = frame.name + "%d.jpg"
-        frameNameOut = frame.name + "1.jpg"
-        ffmpeg = ["ffmpeg", "-i", video.name, "-an", "-ss", str(ss), "-t", 
-                  "01", "-r", "1", "-y", frameName]
-        retcode = subprocess.call(ffmpeg)
-        try:
-            shutil.move(frameNameOut, frame.name)
-            listFramesNames.append(frame.name)
-            listFrames.append(frame)
-        except:
-            pass
+    # Total frames = videoLength * 15fps. Hence for get 16 snapshots.
+    # (not forgetting a snapshot at frame=0)
+    framestep = "framestep=" + str(int((videoLength * 15)/17))
+    mplayer = ["mplayer", "-vf", framestep, "-framedrop", "-nosound",
+               "-quiet", video.name, "-speed", "100", "-vo", 
+               "jpeg:outdir=" + tempDir]
+    retcode = subprocess.call(mplayer)
+    listFramesNames = os.listdir(tempDir)
+    listFramesNames.sort()
     montageCommand = ["montage", "-geometry", "180x135+4+4", "-frame", "5"]
     for frame in listFramesNames:
-        montageCommand.append(frame)
+        montageCommand.append(tempDir + "/" + frame)
     montageCommand.append(montage.name)
     retcode = subprocess.call(montageCommand)
+    shutil.rmtree(tempDir)
     return montage
 
 def storeFile(tmpFile, copyLocation, symLocation):
@@ -358,7 +367,10 @@ def main():
         twit = parseTwitter(options.twit)
     else:
         twit = False
-        
+    
+    # Only one instance of Autotesting should be running.
+    me = SingleInstance()
+    
     # Main loop
     display = displayNumber()
     tests = parseTest(options.tests)
diff --git a/debian/control b/debian/control
index d1e9395..e5df34a 100644
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,7 @@ Homepage: <insert the upstream URL, if relevant>
 
 Package: autotesting
 Architecture: any
-Depends: python, python-amara, wget, Xvfb, xloadimage, qemu, recordmydesktop, ffmpeg, imagemagick, gmessage
+Depends: python, python-amara, wget, Xvfb, xloadimage, qemu, recordmydesktop, mplayer, imagemagick, gmessage, python-twitter
 Description: automatically test by video qemu booting
  autotesting is a script which records qemu booting. Designed to be run
  as a cron job. Mainly used for testing liveCD images.
diff --git a/tests-source/build-60alpha1-amd64-iso-hybrid-all-monthly.xml b/tests-source/build-60alpha1-amd64-iso-hybrid-all-monthly.xml
index a3311ad..5ff2bcf 100644
--- a/tests-source/build-60alpha1-amd64-iso-hybrid-all-monthly.xml
+++ b/tests-source/build-60alpha1-amd64-iso-hybrid-all-monthly.xml
@@ -1,6 +1,7 @@
 <autotesting>
   <merge>
     <common>common-squeeze-build.xml</common>
+    <qemu>qemu.xml</qemu>
     <processors>
       <processor>processor-amd64.xml</processor>
     </processors>
diff --git a/tests-source/build-60alpha1-i386-iso-hybrid-all-monthly.xml b/tests-source/build-60alpha1-i386-iso-hybrid-all-monthly.xml
index 449cd6a..89e8b27 100644
--- a/tests-source/build-60alpha1-i386-iso-hybrid-all-monthly.xml
+++ b/tests-source/build-60alpha1-i386-iso-hybrid-all-monthly.xml
@@ -1,6 +1,7 @@
 <autotesting>
   <merge>
     <common>common-squeeze-build.xml</common>
+    <qemu>qemu.xml</qemu>
     <processors>
       <processor>processor-i386.xml</processor>
     </processors>
diff --git a/tests-source/build-60alpha1-i386-iso-hybrid-xfce-daily.xml b/tests-source/build-60alpha1-i386-iso-hybrid-xfce-daily.xml
index 78d65c3..1d8d940 100644
--- a/tests-source/build-60alpha1-i386-iso-hybrid-xfce-daily.xml
+++ b/tests-source/build-60alpha1-i386-iso-hybrid-xfce-daily.xml
@@ -1,6 +1,7 @@
 <autotesting>
   <merge>
     <common>common-squeeze-build.xml</common>
+    <qemu>qemu.xml</qemu>
     <processors>
       <processor>processor-i386.xml</processor>
     </processors>
diff --git a/tests-source/build-60alpha1-powerpc-iso-all-monthly.xml b/tests-source/build-60alpha1-powerpc-iso-all-monthly.xml
index 3d95a5f..8da80bb 100644
--- a/tests-source/build-60alpha1-powerpc-iso-all-monthly.xml
+++ b/tests-source/build-60alpha1-powerpc-iso-all-monthly.xml
@@ -1,6 +1,7 @@
 <autotesting>
   <merge>
     <common>common-squeeze-build.xml</common>
+    <qemu>qemu-powerpc.xml</qemu>
     <processors>
       <processor>processor-powerpc.xml</processor>
     </processors>
diff --git a/tests-source/build-stage1.xml b/tests-source/build-stage1.xml
index 87303ec..038f9fa 100644
--- a/tests-source/build-stage1.xml
+++ b/tests-source/build-stage1.xml
@@ -51,6 +51,12 @@
       <xsl:value-of select="$parts"/><xsl:value-of select="/autotesting/merge/common"/>
     </xsl:variable>
     <xsl:copy-of select="document($common)//autotesting/common/*" />
+
+    <xsl:variable name="qemu" >
+      <xsl:value-of select="$parts"/><xsl:value-of select="/autotesting/merge/qemu"/>
+    </xsl:variable>
+    <xsl:copy-of select="document($qemu)//autotesting/common/*" />
+
   </source>
 </autotesting>
 
diff --git a/tests-source/merge-list.xml b/tests-source/merge-list.xml
index e469382..1062d65 100644
--- a/tests-source/merge-list.xml
+++ b/tests-source/merge-list.xml
@@ -2,8 +2,10 @@
   <merge>
     <files>
       <!-- Daily -->
-      <file>build-60alpha1-i386-iso-hybrid-xfce-daily.xml</file>
+      <file>build-60alpha1-i386-iso-hybrid-lxde-desktop-daily.xml</file>
       <file>webconverger-daily.xml</file>
+      <file>autobuilds.xml</file>      
+      <!-- Weekly -->
       <file>morphix-lightgui.xml</file>
       <!-- Monthly -->
       <file>build-60alpha1-i386-iso-hybrid-all-monthly.xml</file>
diff --git a/tests-source/parts/common-squeeze-build.xml b/tests-source/parts/common-squeeze-build.xml
index 4fe4e41..690939e 100644
--- a/tests-source/parts/common-squeeze-build.xml
+++ b/tests-source/parts/common-squeeze-build.xml
@@ -6,13 +6,6 @@
     <background>http://live.debian.net/image.png</background>
     <title>Debian Live 60alpha1</title>
     <description>Debian Live. 60alpha1, </description>
-    <qemu>
-      <xscreen>800x600x24</xscreen>
-      <options>-cdrom</options>
-      <pause>10</pause>
-      <sendkeys>kp_enter</sendkeys>
-      <time>900</time>
-    </qemu>
     <output>
       <keep>4</keep>
       <root>/var/www/autotesting/</root>
diff --git a/tests-source/parts/images-iso.xml b/tests-source/parts/images-iso.xml
index 28657aa..1bc6a6b 100644
--- a/tests-source/parts/images-iso.xml
+++ b/tests-source/parts/images-iso.xml
@@ -4,7 +4,7 @@
         <image>
           <name>iso</name>
           <extension>.iso</extension>
-          <qemu_options>-boot order=d -cdrom </qemu_options>
+          <qemu_options>-cdrom</qemu_options>
         </image>
       </images>
   </common>
diff --git a/tests/morphix-lightgui.xml b/tests/morphix-lightgui.xml
index d241d57..ab90730 100644
--- a/tests/morphix-lightgui.xml
+++ b/tests/morphix-lightgui.xml
@@ -9,7 +9,7 @@
       <title>Morphix Daily Base.iso</title>
       <description>Morphix Daily autobuild of base.iso (http://distro.ibiblio.org/pub/linux/distributions/morphix/autobuilds/base/basemod-2.6.26-latest.iso)</description>
       <background>http://www.morphix.org/templates/MorphixORG/images/mambo_header.jpg</background>
-      <frequency>daily</frequency>
+      <frequency>weekly</frequency>
       <qemu>
         <xscreen>1024x768x24</xscreen>
         <binary>qemu-system-i386</binary>
diff --git a/tests/webconverger-daily.xml b/tests/webconverger-daily.xml
index 6f8cde1..69abc30 100644
--- a/tests/webconverger-daily.xml
+++ b/tests/webconverger-daily.xml
@@ -17,7 +17,7 @@ Building midnight European time the very latest developments.
       <background>http://webconverger.com/logos/flower600.png</background>
       <frequency>daily</frequency>
       <qemu>
-        <xscreen>800x600x24</xscreen>
+        <xscreen>1024x768x24</xscreen>
         <binary>qemu-system-i386</binary>
         <options>-cdrom</options>
         <pause>10</pause>

-- 
debian-live/autotesting



More information about the debian-live-changes mailing list