Sponsored by: Dell EMC Isilon
Details
- Reviewers
markj pjd asomers - Commits
- rG7affbeeab1c9: virstor: basic functional test
% sudo kyua debug -k /usr/tests/sys/Kyuafile geom/class/virstor/virstor_test:basic
Executing command [ gvirstor label -v -s 64M -m 512 virstor.bjyhzA /dev/md0 ]
Executing command [ gvirstor destroy virstor.bjyhzA ]
- Destroying test virstor device: virstor.bjyhzA
- Removing test memory disk: md0
geom/class/virstor/virstor_test:basic -> passed
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
tests/sys/geom/class/virstor/conf.sh | ||
---|---|---|
6 | This is going to create a temporary file every time somebody lists tests cases, which I don't think is what you want. And the temporary file won't even be guaranteed to be unique. I think you should move this into some kind of setup function , and remove the "-u". | |
tests/sys/geom/class/virstor/virstor_test.sh | ||
22 | Unless you _really_ need the device to stay resident in RAM. Also, I find "md0" to be a confusing variable name, because "md0" is also a valid value. I suggest just plain "md" or something else that isn't a valid value. |
tests/sys/geom/class/virstor/conf.sh | ||
---|---|---|
6 | mktemp -u doesn't create files. It's just choosing a probably-unique name for the virstor device. But I agree it doesn't do it very well. Thanks for pointing this out. I'll look into the cleanup issue, I think that's new with the conversion to atf. There must be some way that atf tests usually communicate variables to cleanup functions? | |
tests/sys/geom/class/virstor/virstor_test.sh | ||
22 | Will change. |
tests/sys/geom/class/virstor/conf.sh | ||
---|---|---|
6 | Yeah, communicating values to cleanup functions is usually done through files in the test's temporary directory. See for example TEST_MDS_FILE in geom_subr.sh. |
asomers feedback:
- cleanup was broken since it runs in a different context
- prefer swap to malloc type md
- rename $md0