Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create CI test #210

Closed
wants to merge 30 commits into from
Closed

Create CI test #210

wants to merge 30 commits into from

Conversation

goodoomoodoo
Copy link

No description provided.

@alistair23
Copy link
Contributor

Can you add some more details on how this works? I don't fully understand. Does this mock the kernel interface?


### GpioTest

This test polls the pin output every 500 milliseconds of the RPi, and it monitors whether a toggle of the pin has occurred. If it has occurred, it records the period to toggle the pin. The expected period should be around 1 seconds with a margin of error within 1 millisecond.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 millisecond is a tight margin, can the RPi actually measure that well? What is the actual margin of error that the test checks for to ensure toggling is working as expected?


0.000194 INFO -- Initiating I2C Master Rx Test...
1.017061 INFO -- Setting up for nrf52840dk I2C Master Rx test...
1.017617 INFO -- Sending Messages As Slave...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is maybe a confusing message for the test application to print.

Perhaps instead of Sending Messages As Slave... it should be Test Harness Preparing to Respond to Read Transactions as Slave at Address 0x41

A little verbose, but also very clear.

Comment on lines +12 to +14
1. The test harness presses a button (GPIO toggle) on device-under-test to indicate the device-under-test to prepare interaction and receive message as master.
1. The test harness issues an I2C write transaction of 16 bytes and awaits master to send back read data.
1. The test harness validates that the data received from device-under-test and sent back to test harness matches the expected string sent `"Hello I'm Slave"`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. The test harness presses a button (GPIO toggle) on device-under-test to indicate the device-under-test to prepare interaction and receive message as master.
1. The test harness issues an I2C write transaction of 16 bytes and awaits master to send back read data.
1. The test harness validates that the data received from device-under-test and sent back to test harness matches the expected string sent `"Hello I'm Slave"`.
1. The test harness prepares a buffer of 16 bytes that it will send in response to I2C read requests from the device-under-test.
1. The test harness presses a button (GPIO toggle) on device-under-test to indicate the device-under-test should begin issuing transactions.
1. The device-under-test issues repeated I2C read transactions of 16 bytes, which reads from the test harness.
1. The device-under-test prints the data received over I2C on the console.
1. The test harness validates that the data received from device-under-test and sent back to test harness matches the expected string sent `"Hello I'm Slave"`.

I re-arranged some of the language here to be a little clearer — I believe this should match what is actually happening, but please verify I got it correct.


1. The device-under-test configures itself as I2C master with address 0x40 and awaits button press.
1. The test harness presses a button (GPIO toggle) on device-under-test to indicate the device-under-test to send a message under master.
1. The test harness issues an I2C read transaction of 16 bytes and awaits master to send data.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. The test harness issues an I2C read transaction of 16 bytes and awaits master to send data.
1. The test harness issues an I2C read of 16 bytes and awaits the device-under-test as master to send data over the I2C bus until the local receive buffer is full.

It's a little confusing sometimes what's happening on the bus versus what is happening on the device. I think people usually think of "transactions" as bus transactions. I tried to update this language to be a little clearer, especially around who is actually causing bits to be sent on the bus when.

1. The device-under-test configures itself as I2C slave with address 0x41 and awaits for the RPi to initiate an I2C transaction.
1. The test harness presses sends a message on the bus to initiate the transaction.
1. The test harness issues an I2C write transaction of 17 bytes to address 0x41.
1. The test harness validates that transaction occured if the message was sent and acknowledged by the device-under-test through the function used.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. The test harness validates that transaction occured if the message was sent and acknowledged by the device-under-test through the function used.
1. The test harness validates that the transaction occurred if the message was sent and acknowledged successfully by the device-under-test — message contents are not currently validated, only than an I2C ACK was received for each byte.

@ppannuto
Copy link
Member

ppannuto commented Oct 2, 2024

#276 is an updated iteration of this.

@ppannuto ppannuto closed this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants