SF.net SVN: morphix: [2531] trunk/mmaker/utils/auto-testing/auto_testing. webconverger.sh
[email protected] Thu, 28 Jun 2007 15:20:18 -0700
| Newsgroups | gmane.linux.morphix.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 2531
http://svn.sourceforge.net/morphix/?rev=2531&view=rev
Author: bmsleight
Date: 2007-06-28 15:20:17 -0700 (Thu, 28 Jun 2007)
Log Message:
-----------
Adding a script to test Webconverger ISOs
Added Paths:
-----------
trunk/mmaker/utils/auto-testing/auto_testing.webconverger.sh
Added: trunk/mmaker/utils/auto-testing/auto_testing.webconverger.sh
===================================================================
--- trunk/mmaker/utils/auto-testing/auto_testing.webconverger.sh (rev 0)
+++ trunk/mmaker/utils/auto-testing/auto_testing.webconverger.sh 2007-06-28 22:20:17 UTC (rev 2531)
@@ -0,0 +1,128 @@
+#!/bin/bash
+#
+# Copyleft (c) 2006 Brendan M. Sleight #
+# <bmsleight@barwap._REMOVE_SPAM_TRAP.com> #
+# #
+# This script is licensed under the GNU GPL v2 or later. #
+# #
+# On Debian systems, this license can be obtained via #
+# /usr/share/common-licenses/GPL #
+#
+LOGO=/home/morph/images/webconverger.jpg
+MINILOGO=/home/morph/images/webconverger.jpg
+TODAY=$(date +"%F")
+ISO=$1
+VIDEO=$2
+COMMENTS=$4
+if [ -z "$ISO" -a -z "$VIDEO" ]; then
+ echo "Usage: $0 ISO output.avi [Num capture frames] [comments]"
+ echo
+ echo "e.g. $0 Morphing-Morphix.iso Morphing-Morphix.avi "
+ echo "e.g. $0 Morphing-Morphix.iso Morphing-Morphix.avi 800 "
+ echo "e.g. $0 Morphing-Morphix.iso Morphing-Morphix.avi 1000 \"D/load on 2006-01-01\" "
+ echo
+ echo "This script tests a Webconverger ISO using qemu "
+ echo " and then generates a video"
+ echo
+ exit
+fi
+
+if [ -z "$3" ]; then
+ FRAMES=480
+ else
+ FRAMES=$(expr $3 + 16)
+fi
+
+TMP_D=/tmp/dump/
+DUMPS=$TMP_D/dump
+mkdir $TMP_D 2>/dev/null
+
+qemu -vnc :1 -no-kqemu -full-screen -pidfile $TMP_D/qemu.pid -cdrom $ISO &
+sleep 2
+vncviewer -encodings raw -fullscreen -viewonly 127.0.0.1:1 &
+l=16
+while [ $l -lt $FRAMES ]
+do
+ if [ "$l" -lt "10" ]
+ then
+ convert=$DUMPS'00'$l'.miff'
+ elif [ "$l" -lt "100" ]
+ then
+ convert=$DUMPS'0'$l'.miff'
+ if [ "$l" -eq "22" ]
+ then
+ # vncviewer does not like the jump from grub resolution to 800x600
+ # so we (very ugly) start a new vncview.
+ killall vncviewer
+ vncviewer -encodings raw -fullscreen -viewonly 127.0.0.1:1 &
+ fi
+ else
+ convert=$DUMPS$l'.miff'
+ fi
+ import -display :0 -window root $convert
+# sleep 0.5
+ l=$(expr $l + 1)
+ echo "Frame " $convert " at " $(date +"%F_%H:%M:%S.%N")
+done
+
+kill_pid=$(cat $TMP_D/qemu.pid)
+kill $kill_pid
+rm $TMP_D/qemu.pid
+
+# Make minilog for top corner.
+# This ensures that there is no completely back jpg with no info
+# as mencode seg faults if a jpg is completly empty
+# Hey - it also looks pretty :)
+convert $MINILOGO -resize 200x200 -negate -gravity South -background Black -font Helvetica-Bold -fill white -splice 0x36 -pointsize 35 -draw "text 0,0 'AutoTesting'" -transparent black $TMP_D/minilogo.gif
+convert $TMP_D/minilogo.gif -fill grey50 -colorize 40 $TMP_D/minilogo.gif
+l=16
+while [ $l -lt $FRAMES ]
+do
+ if [ "$l" -lt "10" ]
+ then
+ convert=$DUMPS'00'$l'.miff'
+ elif [ "$l" -lt "100" ]
+ then
+ convert=$DUMPS'0'$l'.miff'
+ else
+ convert=$DUMPS$l'.miff'
+ fi
+
+ echo "Converting $convert -> $convert.jpg"
+# convert $convert -resize 800x600 $convert.jpg
+#
+ convert $convert -resize 800x600 $convert.jpg
+ composite -dissolve 15 -gravity northeast $TMP_D/minilogo.gif $convert.jpg $convert.jpg
+ rm $convert
+ l=$(expr $l + 1)
+done
+
+# Create the intro to the video
+title="Autotesting using Qemu"
+text=" $ISO - General Comments \n \n $COMMENTS"
+FOLD_TEXT=$(echo "$text" | fold -s -w 100 )
+convert $LOGO -resize 200 /tmp/logo.jpg
+convert -size 600x440 xc:white -pointsize 25 -fill darkblue -annotate 0x0+250+75 "$title" -pointsize 10 -fill blue -annotate 0x0+50+200 "$FOLD_TEXT" -append /tmp/logo.jpg -bordercolor darkblue -border 20x20 -flatten "$DUMPS"0.jpg
+convert "$DUMPS"0.jpg -resize 800x600 "$DUMPS"1.jpg
+mv "$DUMPS"1.jpg "$DUMPS"0.jpg
+l=1
+while [ $l -lt 16 ]
+do
+ if [ "$l" -lt "10" ]
+ then
+ convert=$DUMPS'00'$l'.miff.jpg'
+ elif [ "$l" -lt "100" ]
+ then
+ convert=$DUMPS'0'$l'.miff.jpg'
+ else
+ convert=$DUMPS$l'.miff.jpg'
+ fi
+ composite -dissolve 15 -gravity northeast $TMP_D/minilogo.gif "$DUMPS"0.jpg $convert
+ l=$(expr $l + 1)
+done
+
+mencoder mf://$TMP_D*.jpg -mf w=800:h=600:fps=4:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o $VIDEO
+ffmpeg2theora $VIDEO --artist "AutoTesting" --title "$VIDEO $COMMENTS" --organization "www.morphix.org" --copyright "copyleft" --date "$TODAY"
+rm $VIDEO
+rm $TMP_D -r
+rm /tmp/logo.jpg
Property changes on: trunk/mmaker/utils/auto-testing/auto_testing.webconverger.sh
___________________________________________________________________
Name: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/