Page MenuHomeFreeBSD

virstor: basic functional test
ClosedPublic

Authored by rlibby on Fri, Jun 7, 8:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 26, 10:30 AM
Unknown Object (File)
Tue, Jun 25, 3:19 PM
Unknown Object (File)
Wed, Jun 12, 3:09 AM
Unknown Object (File)
Tue, Jun 11, 3:30 PM
Unknown Object (File)
Tue, Jun 11, 4:48 AM
Unknown Object (File)
Mon, Jun 10, 5:16 PM
Subscribers

Details

Summary

Sponsored by: Dell EMC Isilon

Test Plan

% 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 ]

  1. Destroying test virstor device: virstor.bjyhzA
  2. 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

rlibby requested review of this revision.Fri, Jun 7, 8:25 PM

tap is highly discouraged for new code. Can you use ATF instead?

asomers: tap was a bad example, use atf

realized we may need to wait after the re-taste

asomers requested changes to this revision.Sun, Jun 9, 8:41 PM
asomers added inline comments.
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".
Worse, I think that the cleanup routine is executed in a different process, which means that it won't even have the correct value for $name.

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.

This revision now requires changes to proceed.Sun, Jun 9, 8:41 PM
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.

rlibby marked 3 inline comments as done.

asomers feedback:

  • cleanup was broken since it runs in a different context
  • prefer swap to malloc type md
  • rename $md0
This revision is now accepted and ready to land.Sun, Jun 9, 11:34 PM
This revision was automatically updated to reflect the committed changes.