summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ubuntu/bootchart-install.yaml32
-rw-r--r--ubuntu/bootchart.yaml30
-rwxr-xr-xubuntu/scripts/bootchartscript.sh27
-rw-r--r--ubuntu/scripts/bootcharttest.py20
4 files changed, 103 insertions, 6 deletions
diff --git a/ubuntu/bootchart-install.yaml b/ubuntu/bootchart-install.yaml
new file mode 100644
index 0000000..fb5ad11
--- /dev/null
+++ b/ubuntu/bootchart-install.yaml
@@ -0,0 +1,32 @@
+metadata:
+ name: bootchart-install
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Test if bootchart is installed. This is first step to run bootchart.yaml test which measures the boot time"
+ maintainer:
+ - Fathi Boudra <fathi.boudra@linaro.org>
+ - Milosz Wasilewski <milosz.wasilewski@linaro.org>
+ os:
+ - ubuntu
+ devices:
+ - arndale
+ - panda
+ - beaglebone-black
+ - beagle-xm
+ - mx53loco
+ - vexpress
+ - highbank
+ scope:
+ - functional
+
+install:
+ deps:
+ - bootchart
+ - lsb-release
+ - pybootchartgui
+
+run:
+ steps:
+ - dpkg-query -l bootchart
+ - dpkg-query -l pybootchartgui
+ - lava-test-case bootchart-install --shell dpkg-query -L bootchart
+ - lava-test-case pybootchartgui-install --shell dpkg-query -L pybootchartgui
diff --git a/ubuntu/bootchart.yaml b/ubuntu/bootchart.yaml
index 3addf3c..e42a4a8 100644
--- a/ubuntu/bootchart.yaml
+++ b/ubuntu/bootchart.yaml
@@ -1,17 +1,35 @@
metadata:
name: bootchart
format: "Lava-Test-Shell Test Definition 1.0"
- description: "Test bootchart in ubuntu."
+ description: "Test case that measures the boot time."
+ maintainer:
+ - Fathi Boudra <fathi.boudra@linaro.org>
+ - Milosz Wasilewski <milosz.wasilewski@linaro.org>
+ os:
+ - ubuntu
+ devices:
+ - arndale
+ - panda
+ - beaglebone-black
+ - beagle-xm
+ - mx53loco
+ - vexpress
+ - highbank
+ scope:
+ - performance
install:
deps:
- bootchart
+ - lsb-release
- pybootchartgui
- bzr-repos:
- - lp:~linaro-foundations/lava-test/bootchartscript
+ git-repos:
+ - http://git.linaro.org/git-ro/qa/test-definitions.git
run:
steps:
- - "cd bootchartscript"
- - "lava-test-case bootchartscript --shell ./bootchartscript.sh"
- - "lava-test-case-attach bootchartscript bootchart.log text/plain"
+ - cd test-definitions/ubuntu/scripts
+ - lava-test-case bootchartscript --shell ./bootchartscript.sh
+ - lava-test-case-attach bootchartscript bootchart.log text/plain
+ - BOOTTIME=`cat bootchart.log | grep time | awk '{print $2}'`
+ - lava-test-case boot-time --result pass --measurement $BOOTTIME --units seconds
diff --git a/ubuntu/scripts/bootchartscript.sh b/ubuntu/scripts/bootchartscript.sh
new file mode 100755
index 0000000..d426784
--- /dev/null
+++ b/ubuntu/scripts/bootchartscript.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+base="$(hostname -s)-$(lsb_release -sc)-$(date +%Y%m%d)"
+
+# Wait for log files to become available
+sleep 60
+file=`find /var/log/bootchart/ -name "$base-*.tgz"`
+if [ -z "$file" ]; then
+ sleep 60
+fi
+file=`find /var/log/bootchart/ -name "$base-*.tgz"`
+if [ -z "$file" ]; then
+ echo "No bootchart log file available"
+ exit 1
+fi
+
+count=1
+while [ -e "/var/log/bootchart/$base-$count.tgz" -o -e "/var/log/bootchart/$base-$count.png" -o -e "/var/log/bootchart/$base-$count.svg" ]
+do
+ count=$(( $count + 1 ))
+done
+count=$(( $count - 1 ))
+
+BASE="/var/log/bootchart/$base-$count"
+TARBALL="$BASE.tgz"
+
+python $PWD/bootcharttest.py $TARBALL -q > bootchart.log
diff --git a/ubuntu/scripts/bootcharttest.py b/ubuntu/scripts/bootcharttest.py
new file mode 100644
index 0000000..31e5527
--- /dev/null
+++ b/ubuntu/scripts/bootcharttest.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+import sys
+from pybootchartgui import main
+from pybootchartgui import parsing
+
+if __name__ == '__main__':
+ argv = sys.argv[1:]
+ parser = main._mk_options_parser()
+ options, args = parser.parse_args(argv)
+ writer = main._mk_writer(options)
+ res = parsing.parse(writer, args, options.prune, options.crop_after, options.annotate)
+ duration = float(res[3].duration)/100
+ print res[0]['title']
+ print "uname:", res[0]['system.uname']
+ print "release:", res[0]['system.release']
+ print "CPU:", res[0]['system.cpu']
+ print "kernel options:", res[0]['system.kernel.options']
+ print "time:", duration
+