Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 58828 Build 55715: arc lint + arc unit
Event Timeline
however I am not really sure what is the suggested way of loading and unloading a kernel module in ATF script.
It's ok to simply load it at the beginning of each test. Something like if ! kldload -n snd_dummy; then atf_skip ...
usr.sbin/mixer/tests/mixer_test.sh | ||
---|---|---|
33 | if ! mixer >/dev/null 2>&1; then atf_skip ... fi | |
43 | What is this atf_pass doing? | |
160 | What does it mean to "test muting"? Does this verify that the kernel driver received some command to mute a device? | |
223 | mixer exits with status 0 in these cases? |
usr.sbin/mixer/tests/mixer_test.sh | ||
---|---|---|
43 | It fails in case the mixer does not exist (could also call mixer_exists()), so that we do not execute the command right after it. | |
160 | It checks both if the driver actually responds to (un-)mute commands, and also whether mixer(8)'s argument parsing is correct. | |
223 | Yes. |
Shouldn't we select the snd_dummy device for our mixer tests?
Current default could be set to any device, with not all features available that we want to test. Or am I missing something?
Yes, it would be more robust in case there is more than 1 card attached. I will update the diff shortly.
Introduce set_default() and restore_default() to set the dummy device as the
default one during tests, and restore the default device on cleanup.
usr.sbin/mixer/Makefile | ||
---|---|---|
10 | FYI since the tests are newly (re)added, we also need to modify etc/mtree/BSD.tests.dist to create /usr/tests/usr.sbin/mixer I added it in rG21e98f6d195a5db63b17025f339684048834e1aa |