Skip to content
trentmeester edited this page Dec 7, 2011 · 14 revisions

Groups are simply containers to hold tests. When tnvme is launched, before any test can be run, it instantiates all the groups ever coded in all of history. The groups themselves create instances of their containing test cases relevant to a user supplied, or defaulted value, revision control number. The revision control number forces the creation of test cases which are relavant to the specified NVMe compliance revision being targeted. See this link for complete details of revision control. After instantiation has completed, tnvme will traverse this entire infrastructure of objects calling the appropriate group for the appropriate test, or tests, to execute.

Before a test can be created, it must have a test group to which it belongs. Either a group currently exists for which a new test can be added, or a new group must be created to contain it.

Creating a New Group

All group logic, and all test logic associated with that group are always contained within their own directory. Group directories always start with the constant string "Grp". The steps associated with creating a new group can best be outlined:

1) Copy the tnvme/GrpTemplate directory by renaming it to your own liking.
    a) Remember all groups must start with the constant string "Grp".
2) Rename the files tnvme/GrpYOURNEWGROUP/grpTemplate.* to your own name.
3) Edit the tnvme/GrpYOURNEWGROUP/Makefile as follows:
    a) Modify all references from grpTemplate.cpp to your own name.
    b) Modify the "OUT" variable from libGrpTemplate.a to your own name.
4) Add this new group to the top level tnvme/Makefile under the variable "SUBDIRS".
5) Allow this group to be supported on tnvme's command line
    a) Open tnvme.cpp and search for the string "EDIT HERE" which demonstrate where to add group logic
    b) IMPORTANT: Only ever append new groups, rather than inserting between existing groups. The reference numbering  
       scheme must remain constant throughout time and appending is presently the only way to accomplish this goal.
6) Open file tnvme/GrpYOURNEWGROUP/grpYOURNEWGROUP.h
    a) Modify all references from _GRPTEMPLATE_H_ to your own name.
    b) Modify all references from GrpTemplate to your own name.
    c) Modify the class level comment to describe the reason for the new grouping of tests. This will be visible via  
       doxygen for all to see publically.
7) Open file tnvme/GrpYOURNEWGROUP/grpYOURNEWGROUP.cpp
    a) Modify the constructor's group string description from “Template Group” to your own groups name.
        i) Note: this does have string length requirements, see the Group base class header file.
    b) Modify all references from GrpTemplate to your own name.
    c) Midify #include "grpTemplate.h" to include your header file.
8) Your ready to compile from the top level tnvme/Makefile
    a) Type: make clobber
    b) Type: make
9) You should be able to see your new group and run the example test container therein
    a) To see your new group amongst all others
        i) ./tnmve --summary
    b) To run your new group with the example test case
        i) ./tnvme --test=YOURGROUPNUMBER

Clone this wiki locally