Page MenuHomeFreeBSD

virstor: basic functional test
ClosedPublic

Authored by rlibby on Jun 7 2024, 8:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 22, 9:29 PM
Unknown Object (File)
Sat, Dec 7, 6:03 PM
Unknown Object (File)
Wed, Dec 4, 1:27 AM
Unknown Object (File)
Sun, Dec 1, 3:15 PM
Unknown Object (File)
Sun, Dec 1, 3:15 PM
Unknown Object (File)
Sun, Dec 1, 3:15 PM
Unknown Object (File)
Nov 22 2024, 1:42 AM
Unknown Object (File)
Nov 11 2024, 4:21 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.Jun 7 2024, 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.Jun 9 2024, 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.Jun 9 2024, 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.Jun 9 2024, 11:34 PM
This revision was automatically updated to reflect the committed changes.