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

Add integration test for ListIdentity #31

Merged
merged 2 commits into from
Mar 19, 2025
Merged

Conversation

danomagnum
Copy link
Owner

This pull request introduces a new test for listing device identities and modifies an existing test to correct an expected string. The most important changes include the addition of a new test function and updates to the test configuration.

New test for listing device identities:

  • tests/list_identity_test.go: Added a new test function TestListIdentity to verify the identity of devices on the network. This includes connecting to the device, retrieving its identity, and validating various identity attributes.
  • tests/test_setup.go: Updated TestConfig struct to include a ListIdentify field, which holds the configuration for the new identity tests.
  • tests/test_config template.json: Added a new section ListIdentify to the test configuration template for specifying device identity details.

Correction to existing test:

  • pack_test.go: Modified the expected string in the TestEncodeString function to "STRING,DINT,SINT[82]" to correct the test validation.

Since it hits the NIC and not the PLC itself you don't get the same response as reading the equivalent attributes.

This also works on non-PLC devices so those can be added here also.
@danomagnum danomagnum merged commit d2b5348 into master Mar 19, 2025
@danomagnum danomagnum deleted the listIdentityFixes branch March 19, 2025 22:23
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.

1 participant