aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/hob-dogtail/recipeReloadMachine.py
blob: c60e79660c62e887c0263a0d7d7ebc9ad9e6b377 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from dogtail import tree
from dogtail.utils import run
from time import sleep
from os import environ, path, remove
import sys, string, os
import subprocess
from subprocess import call
import time
from dogtail.tree import predicate
from base import Base

try:
    bitbake = tree.root.application('bitbake')
except:
    print "can not connect to the application"
else:
    try:
        hob = bitbake.child( roleName='frame' )
    except:
        print "can not connect to the application"

class MachineChange(Base):

    def machineChange(self):
        self.selectMachine('qemumips')
        self.selectImage('core-image-minimal')

        try:
            hob.child('Edit image recipe').click()
        except:
            self.writeInFile("Recipe list re-load for machine change: can not find recipe reload button")
            return 10

        x = hob.child('Included recipes')
        listaImensa = x.findChildren(predicate.GenericPredicate(roleName="table cell"))

        qemumips = len(listaImensa)
        try:
            hob.child('Cancel').click()
        except:
            self.writeInFile("Recipe list re-load for machine change: can not find cancel button")
            return 10
        time.sleep(10)

        self.selectMachine('qemux86')
        time.sleep(20)
	self.selectImage('core-image-minimal')
	time.sleep(5)
        try:
            hob.child('Edit image recipe').click()
        except:
            self.writeInFile("Recipe list re-load for machine change: can not find recipe reload button")
            return 10

        x = hob.child('Included recipes')
        listaImensa = x.findChildren(predicate.GenericPredicate(roleName="table cell"))

        qemux = len(listaImensa)
        try:
            hob.child('Cancel').click()
        except:
            self.writeInFile("Recipe list re-load for machine change: can not find cancel button")
            return 10
        time.sleep(5)

        if(qemux== qemumips):
            self.writeInFile("Recipe list re-load for machine change: failed")
        else:
            self.writeInFile("Recipe list re-load for machine change: passed")
	scriptname=os.path.basename(__file__)
	print "Ending "+scriptname
        return 10