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

Downgrade config generation #362

Merged
merged 24 commits into from
Jun 17, 2022
Merged

Downgrade config generation #362

merged 24 commits into from
Jun 17, 2022

Conversation

grafnu
Copy link
Collaborator

@grafnu grafnu commented Jun 15, 2022

Addresses #334 and b/234435528

Main contribution is a new MessageDowngrader class that is used to downgrade a configuration message when it's applied for a device: validator/src/main/java/com/google/daq/mqtt/registrar/MessageDowngrader.java

tests/downgrade.site is a small test site_model (rather than using the external udmi_site_model) that is used for an integration test on this (runs bin/registrar and compares the output against redacted expected files).

There's also a unit tests for the MessageDowngrader class (and supporting .json files for consumption)

Everything else is all the other bits to make it fit together, or testing infrastructure.

@grafnu grafnu marked this pull request as ready for review June 15, 2022 14:55
bin/test_sites Show resolved Hide resolved
bin/test_sites Outdated
testdir=${OPTARG}
;;
\?)
echo "Usage: $0 [-f] [-n] [-d TEST_DATA_DIR]"
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove -f -n ?

assertTrue("subsystem", simpleConfig.get("localnet").has("subsystem"));
}

private JsonNode getSimpleTestConfig(String filename) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a popular java junit convention for whether helper methods go at top (above tests) or bottom? Whichever it is--it may be this--can we do it? I'll follow.

@grafnu
Copy link
Collaborator Author

grafnu commented Jun 17, 2022 via email

@grafnu grafnu merged commit 94650a8 into faucetsdn:master Jun 17, 2022
@grafnu grafnu deleted the downgrade branch June 17, 2022 16:19
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.

None yet

2 participants