~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/tc-testing/creating-plugins/AddingPlugins.txt

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/testing/selftests/tc-testing/creating-plugins/AddingPlugins.txt (Version linux-6.12-rc7) and /tools/testing/selftests/tc-testing/creating-plugins/AddingPlugins.txt (Version linux-4.10.17)


  1 tdc - Adding plugins for tdc                      
  2                                                   
  3 Author: Brenda J. Butler - bjb@mojatatu.com       
  4                                                   
  5 ADDING PLUGINS                                    
  6 --------------                                    
  7                                                   
  8 A new plugin should be written in python as a     
  9 There are some examples in plugin-lib.            
 10                                                   
 11 The plugin can be used to add functionality to    
 12 such as:                                          
 13                                                   
 14 - adding commands to be run before and/or afte    
 15 - adding commands to be run before and/or afte    
 16 - adding commands to be run before and/or afte    
 17 - ability to alter the command to be run in an    
 18     pre        (the pre-suite stage)              
 19     prepare                                       
 20     execute                                       
 21     verify                                        
 22     teardown                                      
 23     post       (the post-suite stage)             
 24 - ability to add to the command line args, and    
 25                                                   
 26                                                   
 27 The functions in the class should follow the f    
 28                                                   
 29     def __init__(self)                            
 30     def pre_suite(self, testcount, testidlist)    
 31     def post_suite(self, ordinal)                 
 32     def pre_case(self, test_ordinal, testid)      
 33     def post_case(self)                           
 34     def pre_execute(self)                         
 35     def post_execute(self)                        
 36     def adjust_command(self, stage, command)      
 37     def add_args(self, parser)                    
 38     def check_args(self, args, remaining)         
 39                                                   
 40                                                   
 41 PRE_SUITE                                         
 42                                                   
 43 This method takes a testcount (number of tests    
 44 testidlist (array of test ids for tests that w    
 45 useful for various things, including when an e    
 46 rest of the tests must be skipped.  The info i    
 47 and the post_suite method can refer to it when    
 48 TAP output.  The tdc.py script will do that fo    
 49 defined in the test case, but if the plugin is    
 50 tests on each test (eg, check for memory leaks    
 51 co-processes) then that other tap output can b    
 52 post-suite method using this info passed in to    
 53                                                   
 54                                                   
 55 SKIPPING                                          
 56                                                   
 57 The post_suite method will receive the ordinal    
 58 test to be attempted.  It can use this info wh    
 59 the TAP output for the extra test cases.          
 60                                                   
 61                                                   
 62 PRE_CASE                                          
 63                                                   
 64 The pre_case method will receive the ordinal n    
 65 and the test id.  Useful for outputing the ext    
 66                                                   
 67                                                   
 68 ADJUST                                            
 69                                                   
 70 The adjust_command method receives a string re    
 71 the execution stage and a string which is the     
 72 executed.  The plugin can adjust the command,     
 73 execution.                                        
 74                                                   
 75 The stages are represented by the following st    
 76                                                   
 77     'pre'                                         
 78     'setup'                                       
 79     'command'                                     
 80     'verify'                                      
 81     'teardown'                                    
 82     'post'                                        
 83                                                   
 84 The adjust_command method must return the adju    
 85 can use it.                                       
 86                                                   
 87                                                   
 88 ADD_ARGS                                          
 89                                                   
 90 The add_args method receives the argparser obj    
 91 arguments to it.  Care should be taken that th    
 92 conflict with any from tdc.py or from other pl    
 93 concurrently.                                     
 94                                                   
 95 The add_args method should return the argparse    
 96                                                   
 97                                                   
 98 CHECK_ARGS                                        
 99                                                   
100 The check_args method is so that the plugin ca    
101 the args, if needed.  If there is a problem, a    
102 be raised, with a string that explains the pro    
103                                                   
104 eg:  raise Exception('plugin xxx, arg -y is wr    
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php