[oe-commits] org.oe.angstrom-2007.12-stable teslab: add and activate by default
koen commit
oe at amethyst.openembedded.net
Wed Mar 26 09:17:09 UTC 2008
teslab: add and activate by default
Author: koen at openembedded.org
Branch: org.openembedded.angstrom-2007.12-stable
Revision: be8d100aad01c4a59921cae8dd3b1be39e3e237d
ViewMTN: http://monotone.openembedded.org/revision/info/be8d100aad01c4a59921cae8dd3b1be39e3e237d
Files:
1
classes/testlab.bbclass
BACKPORTS.txt
conf/distro/include/angstrom.inc
Diffs:
#
# mt diff -r963f8fa0158369baf9c4270782acea485d43908d -rbe8d100aad01c4a59921cae8dd3b1be39e3e237d
#
#
#
# add_file "classes/testlab.bbclass"
# content [b9983768d320bf1635ba3aaa7b32042d13954a0e]
#
# patch "BACKPORTS.txt"
# from [85af4fca13c6c18024b45da17e41888b2997ecf0]
# to [ed4a4925cdaf1f3b02921faef9c6d4ec0bbffbaf]
#
# patch "conf/distro/include/angstrom.inc"
# from [5fbdb442968ada40a44c35ff6e977a5075a96a6c]
# to [a35da1bc49e299e644b351694250e883d1e28e46]
#
============================================================
--- classes/testlab.bbclass b9983768d320bf1635ba3aaa7b32042d13954a0e
+++ classes/testlab.bbclass b9983768d320bf1635ba3aaa7b32042d13954a0e
@@ -0,0 +1,65 @@
+#
+# Performs various tests and analysises on images
+#
+# Copyright (C) 2007, 2008 Koen Kooi <koen at openembedded.org>
+
+# The current features are:
+# 1) dump a list of installed packages
+# 2) dump a list of sizes of installed packages
+# 3) dependency graphs of installed packages
+
+# See
+# * http://dominion.thruhere.net/koen/cms/the-testlab-strikes-again
+# * http://dominion.thruhere.net/koen/cms/package-relations-inside-images
+# for use cases
+
+# TODO:
+# * log information to a server for safekeeping
+# * use mtn certs to record this info into the scm
+# * add test suite to run on the target device
+
+
+# Needs 'dot', 'ipkg-cl'
+
+do_testlab() {
+if [ -e ${IMAGE_ROOTFS}/etc/ipkg ] ; then
+
+ TESTLAB_DIR="${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-testlab"
+ mkdir -p ${TESTLAB_DIR}/
+ ls -laR ${IMAGE_ROOTFS} > ${TESTLAB_DIR}/files-in-image.txt
+
+ echo > ${TESTLAB_DIR}/installed-packages.txt
+ echo -e "digraph depends {\n node [shape=plaintext]" > ${TESTLAB_DIR}/depends.dot
+
+ for pkg in $(ipkg-cl -f ${IMAGE_ROOTFS}/etc/ipkg -o ${IMAGE_ROOTFS} list_installed | awk '{print $1}') ; do
+ ipkg-cl -f ${IMAGE_ROOTFS}/etc/ipkg -o ${IMAGE_ROOTFS} info $pkg | grep Filename | awk -F: '{print $2}' >> ${TESTLAB_DIR}/installed-packages.txt
+
+ for depends in $(ipkg-cl -f ${IMAGE_ROOTFS}/etc/ipkg -o ${IMAGE_ROOTFS} info $pkg | grep Depends) ; do
+ echo "$pkg OPP $depends;" | grep -v "(" | grep -v ")" | grep -v Depends | sed -e 's:,::g' -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' |sed 's:OPP:->:g' >> ${TESTLAB_DIR}/depends.dot
+ done
+
+ for recommends in $(ipkg-cl -f ${IMAGE_ROOTFS}/etc/ipkg -o ${IMAGE_ROOTFS} info $pkg | grep Recom) ; do
+ echo "$pkg OPP $recommends [style=dotted];" | grep -v "(" | grep -v ")" | grep -v Recom | sed -e 's:,::g' -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' |sed 's:OPP:->:g' >> ${TESTLAB_DIR}/depends.dot
+ done
+ done
+
+ echo "}" >> ${TESTLAB_DIR}/depends.dot
+
+ grep -v kernel_2 ${TESTLAB_DIR}/depends.dot | grep -v kernel_image > ${TESTLAB_DIR}/depends-nokernel.dot
+ grep -v libc6 ${TESTLAB_DIR}/depends-nokernel.dot | grep -v libgcc > ${TESTLAB_DIR}/depends-nokernel-nolibc.dot
+ grep -v update_ ${TESTLAB_DIR}/depends-nokernel-nolibc.dot > ${TESTLAB_DIR}/depends-nokernel-nolibc-noupdate.dot
+ grep -v kernel_module ${TESTLAB_DIR}/depends-nokernel-nolibc-noupdate.dot > ${TESTLAB_DIR}/depends-nokernel-nolibc-noupdate-nomodules.dot
+
+ #dot has some library troubles when run under fakeroot, uncomment at your own risk
+ #dot -Tpng -o ${TESTLAB_DIR}/image-dependencies.png ${TESTLAB_DIR}/depends.dot
+ #dot -Tpng -o ${TESTLAB_DIR}/image-dependencies-nokernel-nolibc.png ${TESTLAB_DIR}/depends-nokernel-nolibc.dot
+ #dot -Tpng -o ${TESTLAB_DIR}/image-dependencies-nokernel-nolibc-noupdate.png ${TESTLAB_DIR}/depends-nokernel-nolibc-noupdate.dot
+ #dot -Tpng -o ${TESTLAB_DIR}/image-dependencies-nokernel-nolibc-noupdate-nomodules.png ${TESTLAB_DIR}/depends-nokernel-nolibc-noupdate-nomodules.dot
+
+ for file in $(cat ${TESTLAB_DIR}/installed-packages.txt) ; do
+ du -k $(find ${DEPLOY_DIR_IPK} -name "$file")
+ done | grep "\.ipk" | sed -e s:${DEPLOY_DIR_IPK}::g | sort -n -r | awk '{print $1 "\tKiB " $2}' > ${TESTLAB_DIR}/installed-package-sizes.txt
+fi
+}
+
+IMAGE_POSTPROCESS_COMMAND += " do_testlab ;"
============================================================
--- BACKPORTS.txt 85af4fca13c6c18024b45da17e41888b2997ecf0
+++ BACKPORTS.txt ed4a4925cdaf1f3b02921faef9c6d4ec0bbffbaf
@@ -229,5 +229,7 @@
847c6e3f16104e7b87568edf06d0d9cc79b5e860 db: fix upstream SRC_URI, unify db4. <xjqian koen>
a99dc9b34551aa3889d7057538bf2e37b0471af1 patch.bbclass: Show full path of a patch <koen, xjqian>
complicated : use autotools_stage_all for native packages <koen, xjqian>
+7712d9178e2d4268d697de3c404c8853aa202089 testlab: add it <hvontres, koen>
+552396a9dfe973c66350f15cdf75d1b55fc16adb " "
============================================================
--- conf/distro/include/angstrom.inc 5fbdb442968ada40a44c35ff6e977a5075a96a6c
+++ conf/distro/include/angstrom.inc a35da1bc49e299e644b351694250e883d1e28e46
@@ -29,7 +29,7 @@ MAINTAINER = "Angstrom Developers <angst
#use debian style naming
#use multimachine buildrules
-INHERIT += "debian multimachine sanity devshell angstrom-mirrors insane"
+INHERIT += "debian multimachine sanity devshell angstrom-mirrors insane testlab"
ANGSTROM_PKG_FORMAT ?= "ipk"
require conf/distro/include/angstrom-package-${ANGSTROM_PKG_FORMAT}.inc
More information about the Openembedded-commits
mailing list