~terceiro/lava-dispatcher/lava-test-shell-oe

« back to all changes in this revision

Viewing changes to lava_test_shell/lava-test-runner-ubuntu

  • Committer: Antonio Terceiro
  • Date: 2013-03-13 18:34:36 UTC
  • Revision ID: antonio.terceiro@linaro.org-20130313183436-w25kfbuubgc9o3iy
Do not call distro-specific code unconditionally

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
RESULTSDIR="/lava/results"
6
6
BINDIR="/lava/bin"
7
7
 
 
8
detect_distro() {
 
9
        grep -q -i ubuntu /etc/issue && echo "ubuntu" && return
 
10
 
 
11
        echo "unknown"
 
12
}
 
13
 
8
14
hwcontext()
9
15
{
10
16
        mkdir -p ${RESULTSDIR}/hwcontext
15
21
        [ -f ${meminfo} ] || cat /proc/meminfo > ${meminfo}
16
22
}
17
23
 
18
 
swcontext()
 
24
unknown_swcontext() {
 
25
        mkdir -p ${RESULTSDIR}/swcontext
 
26
        build=${RESULTSDIR}/swcontext/build.txt
 
27
        pkgs=${RESULTSDIR}/swcontext/pkgs.txt
 
28
 
 
29
        # we don't know about the software context
 
30
        echo 'Unsupported distro: cannot determine build version' > "$build"
 
31
        echo 'Unsupported distro: cannot obtain list of installed packages' > "$pkgs"
 
32
}
 
33
 
 
34
ubuntu_swcontext()
19
35
{
20
36
        mkdir -p ${RESULTSDIR}/swcontext
21
37
        build=${RESULTSDIR}/swcontext/build.txt
27
43
        [ -f ${pkgs} ]  || dpkg-query -W -f '${status} ${package} : ${version}\n' | sed -n 's/^install ok installed/package:/p'  > ${pkgs}
28
44
}
29
45
 
 
46
swcontext() {
 
47
        distro=$(detect_distro)
 
48
        ${distro}_swcontext
 
49
}
30
50
 
31
51
cleanup()
32
52
{