Page MenuHomeFreeBSD

hastd: Add full lifecycle test
Needs ReviewPublic

Authored by des on Mon, Sep 14, 10:15 PM.
Tags
None
Referenced Files
F173644666: D59676.diff
Sun, Sep 27, 10:27 AM
Unknown Object (File)
Fri, Sep 25, 2:53 AM
Unknown Object (File)
Thu, Sep 24, 11:24 AM
Unknown Object (File)
Thu, Sep 24, 6:22 AM
Unknown Object (File)
Wed, Sep 23, 11:27 PM
Unknown Object (File)
Wed, Sep 23, 9:58 PM
Unknown Object (File)
Wed, Sep 23, 6:28 AM
Unknown Object (File)
Wed, Sep 23, 2:47 AM
Subscribers

Details

Reviewers
kevans
markj
gjb
pjd
Group Reviewers
tests
Summary

Add a test case that creates and starts two nodes, has one assume the
primary role and the other the secondary role, writes to the device,
verifies that the data is synced to both nodes, then switches the roles,
and finally shuts both nodes down and compares their backing stores.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 76897
Build 73780: arc lint + arc unit

Event Timeline

des requested review of this revision.Mon, Sep 14, 10:15 PM

This relies specifically on IPv4. Can you use localhost instead of 127.0.0.1

sbin/hastd/tests/hastd_test.sh
143–146

This can be handled in the cleanup routine instead.

156–161

This just handles the cleanup once instead of doing it inline in the test.

des marked 2 inline comments as done.Fri, Sep 25, 10:56 AM
des added inline comments.
sbin/hastd/tests/hastd_test.sh
143–146

Then we don't test that hastctl is capable of stopping hastd.

ngie added inline comments.
sbin/hastd/tests/hastd_test.sh
12

BTW: I'd give a ship-it for this change right now -- thank you :)!

143–146

Removing the files with rm -f (and without atf_check) masks issues if the files are missing. That seems less than ideal for the tests if your goal was to confirm that the services are no longer running if the pidfiles are gone.
At the very least leaving the files behind and cleaning them up in cleanup with emit warnings when kyua completes the test -- @jmmv filed an issue for no longer masking cleanup problems at test exit. It might be worth investing in that for a later release [if it's tunable via the config] so items like this can be caught and asserted on loudly.