labgrid-project / labgridhelper Goto Github PK
View Code? Open in Web Editor NEWHelper functions for labgrid tests
Helper functions for labgrid tests
I am trying to emulate a USB stick as described in section 3.4 of the documentation.
My first concern is the USB OTG support. It seems that this protocol is mostly used on embedded devices such as cellphones/tablets. Does anyone know if it can work on a server board (PC)?
My second concern was with setting CONFIG_USB_GADGETFS=m in the kernel config.
I tried to set Mass Storage Gadget as a module using menuconfig:
Device Drivers ---> USB support ---> USB Gadget Support ---> Mass Storage Gadget
but I am not sure it is the same as CONFIG_USB_GADGETFS...
Then, I followed the official CentOS documentation (here and here) to build the kernel but the build failed with errors like:
drivers/usb/gadget/configfs.c:712:2: error: initializer element is not constant
&gadget_strings_serialnumber.attr
For the record, I used: Linux CentOS75 3.10.0-862.6.3.el7.x86_64
I am new with building kernels, not to mention custom kernels, so dont hesitate to correct me if I did something wrong.
I know that these issues are not precisely labgrid related, but these steps are necessary in order to use labgrid features. I think there should be more details in the documentation, or at least point to some doc/examples.
It would also be great to specify the OS, kernel version, special hardware (if any), etc. that were used when the USB stick emulation feature was developped so that we can reproduce if needed.
Note: an e-mail was sent to @Emantor regarding the USB OTG support.
I will follow up on any useful info I get.
We would like to make a generic mechanism in labgrid, which can be used for creating a mktemp(1) directory on target and copy files to that.
def test_hello(request,target):
command = target.get_active_driver( "CommandProtocol")
tmpdir = command.mkdtemp()
tmpdir.put(os.path.join(request.fspath, 'src/hello'))
stdout = command.run_check(tmpdir.path + '/' + 'hello')
mkdtemp() execute mktemp -d on DUT, and returns an object with a put method, which sets the destination directory to the temporary directory.
Now should this feature be added to CommandProtocol or FileTransferProtocol?
The driver needed to do this, must have both!
The Class for the returned object, should of course also be in the labgrid three.
labgrid/util seems to be the most appropriate place.
The returned object is quite limited. It would have been great with at clone of pytest's tmpdir with py.path.local support. But as far as I can see, none of the code can be reused. Thus all needs to be rewritten from scratch.
Implementing this as a function scope fixture would also make sense, but there is no obvious place to put new generic fixtures in the labgrid tree.
The labgrid repository received some PRs for functionality which should go in this helper library:
https://github.com/labgrid-project/labgrid/pulls?q=is%3Apr+label%3Ahelper
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.