I'm working on adding a new test using tast, and I'd like to add some support for udev. I looked into some open-source packages that had go bindings for C code, but I haven't had much success using any of them to make a proof-of-concept.My need for udev is relatively straightforward, I'd like to my test to block until a device with a given vid/pid has been successfully connected on the system. I was able to write a simple C program that can verify if a device with the given vid/pid is present by calling into libudev directly. Is there any best practices for building a tast that uses some C code?
--
You received this message because you are subscribed to the Google Groups "tast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tast-users+...@chromium.org.
To post to this group, send email to tast-...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/tast-users/bc41fba2-87c1-43f0-9276-704dad7a65ae%40chromium.org.
Yeah that's the package I have been experimenting with. I've managed to get something working using the the Monitor type to poll for udev device events.
What are the guidelines for adding a package like this? I'm still very new to go, just went through the "tour' a few days ago.
On Wednesday, December 5, 2018 at 3:21:55 PM UTC-8, Daniel Erat wrote:--I haven't used it before, but https://github.com/jochenvg/go-udev looks like a fairly thin wrapper that wraps libudev using Cgo. If it works, it'd be preferable to use it rather than wrapping your own C code that's specific to your test.It's less efficient and hackier, but if you have some other way to check if the device is currently present (lsusb, lspci, sysfs, etc.), you could also using testing.Poll to wait for it to appear. I'd only recommend this if you aren't able to access udev via existing bindings, though.On Wed, Dec 5, 2018 at 2:24 PM valleau via tast-users <tast-...@chromium.org> wrote:--I'm working on adding a new test using tast, and I'd like to add some support for udev. I looked into some open-source packages that had go bindings for C code, but I haven't had much success using any of them to make a proof-of-concept.My need for udev is relatively straightforward, I'd like to my test to block until a device with a given vid/pid has been successfully connected on the system. I was able to write a simple C program that can verify if a device with the given vid/pid is present by calling into libudev directly. Is there any best practices for building a tast that uses some C code?
You received this message because you are subscribed to the Google Groups "tast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tast-users+...@chromium.org.
To post to this group, send email to tast-...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/tast-users/bc41fba2-87c1-43f0-9276-704dad7a65ae%40chromium.org.
You received this message because you are subscribed to the Google Groups "tast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tast-users+...@chromium.org.
To post to this group, send email to tast-...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/tast-users/c5e7b83f-3a9b-4715-8da0-73cd01d6d38f%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/tast-users/CAJZv9cuGXL__kxaY%3DDr_8uTaHFJT0NGUBoDqU%2BXqpBQ1RHspdg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/tast-users/CAJZv9ctBproYken7dMaN52MiBLzsmBbkhccRkEPCOv77m-7Vgw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/tast-users/CAJZv9cvE201JinjCsk2N8TJUzwxbE%2BjRdc0-7epF_cZvbNXvEQ%40mail.gmail.com.