[tbot] [DENX] tbot: board hangs if no autoload

Harald Seiler hws at denx.de
Fri Nov 16 09:48:36 UTC 2018


On Thu, 2018-11-15 at 19:22 +0100, Stefano Babic wrote:
> Hi Harald,
> 
> On 15/11/18 16:59, Harald Seiler wrote:
> > Hi Stefano, Heiko,
> > 
> > you two keep posting so much that I can't even keep up
> > with it ;) I'll try to chime in on some aspects to maybe
> > clear things up.  I hope it's not too confusing ...
> 
> :-)
> 
> > 
> > 

[...]

> > > > Or better, it maybe is detectable through a testcase, executed on the
> > > > lab PC ?
> > > > 
> > > > The tftp serverip is configured somewhere on the lab PC ... so write a
> > > > testcase
> > > 
> > > But a lab PC is not strictly required, and we have not. If you see the
> > > code, I manage to add my lab simply having my own board/lab.py instead
> > > of board/denx.py, and I inherit my board (mira) from it.
> > 
> > By default, TBot just uses your localhost as a "lab PC".
> > 
> > In the denx repo, board/denx.py is just a convenience to reduce code
> > duplication. 
> 
> I find it a nice convenience that I can reuse to redefine my internal
> "lab" commands
> 
> > If you want to add your own lab, you'd be better off creating
> > a labs/sbabic.py.
> 
> Yes, this is what I did.
> 
> >  But I am not sure if that should reside in our
> > denx repo.
> 
> No, it makes no sense - it is just a definition for my own lab.
> 

I think it would be good practice for people to add this base class in
their local repo and add it to `.git/info/exclude` so it won't be pushed.

The if guard in the board configs are ok to be pushed, they won't hurt
others.  So you can definitely push your Mira board config!

> > 
> > 
> > If you want a board to work in multiple labs, you could make
> > the board-config check which lab was selected and use a different
> > base class depending on that:
> > 
> > 	if tbot.selectable.LabHost.name == "pollux":
> > 	    # Use pollux specific config
> > 	    import denx
> > 	    BoardBase = denx.DenxBoard
> > 	elif tbot.selectable.LabHost.name == "sbabic":
> > 	    # Use your personal lab config
> > 	    import sbabic
> > 	    BoardBase = sbabic.SbabicBoard
> > 	else:
> > 	    raise NotImplementedError("Board not available on this labhost!")
> > 
> > 	class Mira(BaseBoard):
> > 	    ...
> 
> Good idea, thanks, I will do in this way.
> 
> > 
> > > > for it, which returns the ip ... and you do not need to configure it!
> > 
> > If `serverip` proves to be needed enough times, we could add it as an option
> > to the labhost:
> > 
> > 	class PolluxLab(lab.SSHLabHost):
> > 	    ...
> > 	    serverip = "192.168.1.1"
> 
> That means, if I use the default host, should I derive my own class
> (Let's say, SbabicLab) from LabHost, adding serverip or whatever I want,
> and then at the end LAB = SbabicLab ? Is this the correct way ?

I guess you figured it out already.  But for completenesses sake:

	#tbot-denx/labs/sbabic.py
	class SbabicLab(lab.LocalLabHost):
	    name = "sbabic"
	    serverip = "your.server.ip"

(If your localhost is your labhost, that is ...)

> 
> > 
> > and check it using
> > 
> > 	# Board config
> > 	tbot.selectable.LabHost.serverip
> > 	# or cleaner (maybe even with a default value?):
> > 	getattr(tbot.selectable.LabHost, "serverip", "192.168.0.1")
> 
> ok
> 
> > 

[...]

> 
> 
> Stefano
> 

-- 
Harald

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-62  Fax: +49-8142-66989-80   Email: hws at denx.de


More information about the tbot mailing list