(file) Return to PEP121_-_TestEnhancements-1.3.html CVS log (file) (dir) Up to [Pegasus] / pegasus / test / TestProviders

  1 s.soni 1.1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2            <html>
  3            <head>
  4 kumpf  1.2 
  5 s.soni 1.1   <meta content="en-us" http-equiv="Content-Language">
  6 kumpf  1.2 
  7 s.soni 1.1   <meta content="Microsoft FrontPage 5.0" name="GENERATOR">
  8 kumpf  1.2 
  9 s.soni 1.1   <meta content="FrontPage.Editor.Document" name="ProgId">
 10 kumpf  1.2 
 11 s.soni 1.1   <meta content="text/html; charset=windows-1252"
 12             http-equiv="Content-Type">
 13              <title>PEP</title>
 14 kumpf  1.2 
 15 s.soni 1.1   <link href="PEP000_PEPTemplate_files/info1.css" rel="stylesheet">
 16            </head>
 17              <body>
 18 kumpf  1.2 
 19            <hr>
 20 s.soni 1.1 <p align="center"><small><font face="Helvetica, Arial, sans-serif"><b><font
 21             size="4"><small>Pegasus Enhancement Proposal (PEP)</small></font></b></font></small></p>
 22 kumpf  1.2 
 23 s.soni 1.1 <p><small><font face="Helvetica, Arial, sans-serif"><b>PEP #:</b> 121</font></small></p>
 24                     <small><font face="Helvetica, Arial, sans-serif"><b>Title: </b>Test
 25 kumpf  1.2   Enhancements   for Pegasus </font></small>
 26 s.soni 1.1 <p><small><font face="Helvetica, Arial, sans-serif" color="#0000ff"></font></small></p>
 27 kumpf  1.2 
 28 s.soni 1.1 <p><small><font face="Helvetica, Arial, sans-serif"><b>Version: </b>1.3 </font></small></p>
 29 kumpf  1.2 
 30            <p><small><font face="Helvetica, Arial, sans-serif"><b>Created:</b> 18 Dec.
 31 s.soni 1.1     2003</font><font face="Helvetica, Arial, sans-serif" color="#0000ff"></font></small></p>
 32 kumpf  1.2 
 33 s.soni 1.1 <p><small><font face="Helvetica, Arial, sans-serif"><b>Authors: Subodh Soni</b></font></small></p>
 34 kumpf  1.2 
 35 s.soni 1.1 <p><small><font face="Helvetica, Arial, sans-serif"><b>Status:  </b>Final<br>
 36                     </font></small></p>
 37 kumpf  1.2 
 38 s.soni 1.1 <p><small><font face="Helvetica, Arial, sans-serif"><br>
 39                     </font></small></p>
 40 kumpf  1.2 
 41 s.soni 1.1 <p><small><font face="Helvetica, Arial, sans-serif"><b>Version History:</b></font></small></p>
 42 kumpf  1.2 
 43 s.soni 1.1 <table border="1" cellspacing="1" bordercolordark="#666666"
 44             bordercolorlight="#CCCCCC" width="100%" style="font-family: Arial;">
 45                       <tbody>
 46                         <tr>
 47                           <th bgcolor="#cae6ca"><small>Version</small></th>
 48                           <th bgcolor="#cae6ca"><small>Date</small></th>
 49                           <th bgcolor="#cae6ca"><small>Author</small></th>
 50                           <th bgcolor="#cae6ca"><small>Change Description</small></th>
 51                         </tr>
 52                         <tr>
 53                           <td align="center"><small>1.0</small></td>
 54                           <td align="center"><small>18 Dec 2003</small></td>
 55                           <td align="center"><small>Subodh Soni</small></td>
 56                           <td><small>Initial Submission</small></td>
 57                         </tr>
 58                         <tr>
 59                           <td align="center"><small>1.1</small></td>
 60                           <td align="center"><small>13 Jan 2004</small></td>
 61                           <td align="center"><small>Subodh Soni</small></td>
 62                           <td><small>Minor editorial changes based on comments by David
 63              Dillard</small> </td>
 64 s.soni 1.1              </tr>
 65                   <tr>
 66                     <td valign="top" align="center"><small>1.2</small><br>
 67                     </td>
 68                     <td valign="top" align="center"><small>02 Feb 2004</small><br>
 69                     </td>
 70                     <td valign="top" align="center"><small>Subodh Soni</small><br>
 71                     </td>
 72                     <td valign="top" align="left"><small>Priorities of the proposed
 73            test  enhancements added.</small><br>
 74                     </td>
 75                   </tr>
 76                <tr>
 77                  <td valign="top" align="center"><small>1.3</small><br>
 78                  </td>
 79                  <td valign="top" align="center"><small>05 Feb 2004</small><br>
 80                  </td>
 81                  <td valign="top" align="center"><small>Subodh Soni</small><br>
 82                  </td>
 83                  <td valign="top"><small>Final Version uploaded to "Recent Documents"</small><br>
 84                  </td>
 85 s.soni 1.1     </tr>
 86 kumpf  1.2 
 87              </tbody>
 88 s.soni 1.1 </table>
 89                     <br>
 90                     <br>
 91 kumpf  1.2 
 92            <hr>
 93            <p><small><font face="Helvetica, Arial, sans-serif"><b>Abstract:</b> This
 94                PEP aims to deliver test enhancements for Pegasus CIMOM. These enhancements
 95                introduce some specific conditions in the CIMOM and check its behavior.
 96              These  conditions or test scenarios are the ones that are not tested in
 97            the  current  implementation of Pegasus and consists of some of the real-life
 98             issues faced  by the developers and users (working with various configurations
 99             and machine setups) of Pegasus . The different test cases are present in
100 s.soni 1.1 the form of either sample providers or shell scripts and are independent of
101            the existing test programs present in the Pegasus CVS tree.The complete package
102            containing these test cases can be easily integrated with the existing source
103            tree and no special knowledge is required to execute these tests.</font></small></p>
104 kumpf  1.2 
105            <hr>
106            <h2><small><font face="Helvetica, Arial, sans-serif" color="#000000">Definition
107 s.soni 1.1     of the Problem</font></small></h2>
108 kumpf  1.2 
109            <p><small><font face="Helvetica, Arial, sans-serif">There are many scenarios
110                where the cimom behavior is not known as of the current pegasus stable
111             source   tree. This PEP is an attempt to identify some of these scenarios
112             and develop   test programs to check the behavior exhibited by pegasus when
113 s.soni 1.1  subjected to  these conditions.<br>
114                     </font></small></p>
115 kumpf  1.2 
116            <p><small><font face="Helvetica, Arial, sans-serif"> The problems are defined
117 s.soni 1.1     below: [These are various situations in which the cimserver behavior is
118              not  known/ or inconsistent]<br>
119                     </font></small></p>
120 kumpf  1.2 
121            <p><small><font face="Helvetica, Arial, sans-serif">1. Single provider responsible
122                for loading multiple classes and running multiple clients simultaneously
123 s.soni 1.1    using the classes loaded by this provider.<br>
124                     </font><font face="Helvetica, Arial, sans-serif"
125             color="#ff6666"></font><font face="Helvetica, Arial, sans-serif"><br>
126 kumpf  1.2          2. Behavior of Pegasus is different depending on whether the exception
127               thrown is a CIMException, Pegasus::Exception, or "unknown" exception such
128 s.soni 1.1    as int.  exceptions on initialize, after processing(), etc.</font></small></p>
129 kumpf  1.2 
130            <p><small><font face="Helvetica, Arial, sans-serif">3. What happens if the
131                provider method does a fork() and creates subprocess from within itself.
132               What are the handles  (or file descriptors) it inherits from the parent.
133              These conditions occur frequently when an actual provider interacts with
134 s.soni 1.1  the system through various system calls.<br>
135                     </font></small></p>
136 kumpf  1.2 
137            <p><small><font face="Helvetica, Arial, sans-serif">4. What is the behavior
138                on linux when providers manipulate signals from within their methods.
139 s.soni 1.1 How    is threading and signal handling taken care by pegasus ?<br>
140                     </font></small></p>
141 kumpf  1.2 
142            <p><small><font face="Helvetica, Arial, sans-serif">5. Checking for timing-related
143                issues in the Pegasus common code. Memory testing involving significant
144              exercising  of multiple providers with strange timings, and clients timed
145              to both stress  provider subsystems and pause long enough to exercise the
146 s.soni 1.1   provider unload  logic.<br>
147                     </font></small></p>
148 kumpf  1.2 
149            <p><small><font face="Helvetica, Arial, sans-serif">6. The provider calling
150 s.soni 1.1     the CIMOMHandle sets a UserIdentity into the OperationContext. It is possible
151                for a provider to call the CIMOMHandle with a user name that is different
152                than the end-user on the client who sent in the original request. For
153            example,    a provider could set "root" into the UserIdentity, effectively
154            promoting   itself to root authority when calling the CIMOMHandle.<br>
155                     </font></small></p>
156 kumpf  1.2 
157            <p><small><font face="Helvetica, Arial, sans-serif">7. Testing the behavior
158 s.soni 1.1     of Pegasus when the classes it has implemented return a large amount of
159              data.   (</font><font face="Helvetica, Arial, sans-serif"
160 kumpf  1.2  color="#000000">For example:   a sample provider in which the enumInstances
161 s.soni 1.1    returns 10000 instances of  the class implemented by the provider.<br>
162               </font></small></p>
163 kumpf  1.2 
164 s.soni 1.1 <p><small><font face="Helvetica, Arial, sans-serif" color="#000000">8. </font></small><small><font
165 kumpf  1.2  face="Helvetica, Arial, sans-serif">Checking the XML parser    and generator
166 s.soni 1.1  programs when malformed strings are passed through the providers</font></small><br>
167               </p>
168 kumpf  1.2 
169 s.soni 1.1 <h2><b><small><small><font face="Helvetica, Arial, sans-serif"
170             color="#000000">Priority</font></small></small></b></h2>
171 kumpf  1.2 
172            <p><small><font face="Helvetica, Arial, sans-serif">The priorities of the
173 s.soni 1.1  above mentioned test enhancements can be assigned based on the areas in the
174             pegasus code that require more testing. <br>
175 kumpf  1.2    Based on the above serial nos. the order of the tests can be: <small>2</small>,
176 s.soni 1.1  <small>1, 5, 7,  3, 4, 8, 6</small></font><font
177             face="Helvetica, Arial, sans-serif"><small></small></font></small><br>
178               </p>
179 kumpf  1.2 
180            <h2><small><font face="Helvetica, Arial, sans-serif" color="#000000">Proposed
181 s.soni 1.1     Solution</font></small></h2>
182                     <small><font face="Helvetica, Arial, sans-serif">An attempt is made
183 kumpf  1.2   to  address  the issues/problems/scenarios described in the problem definition
184               above by  writing sample providers, test client programs and various shell
185               scripts.  The sample providers follow the same structure in all the test
186 s.soni 1.1   programs. <br>
187                     Each sample provider is made atleast of the following files :<br>
188                     <br>
189 kumpf  1.2          </font></small>
190 s.soni 1.1 <table border="1" width="100%" cellpadding="2" cellspacing="2">
191                       <tbody>
192                         <tr>
193 kumpf  1.2                <td><font face="Helvetica, Arial, sans-serif"><small>&lt;ProviderName&gt;.cpp</small></font>
194 s.soni 1.1           </td>
195 kumpf  1.2                <td><font face="Helvetica, Arial, sans-serif"><small> Implementing
196 s.soni 1.1     the provider methods</small></font></td>
197                         </tr>
198                         <tr>
199 kumpf  1.2                <td><small><font face="Helvetica, Arial, sans-serif">&lt;ProviderName&gt;.h</font>
200 s.soni 1.1           </small></td>
201 kumpf  1.2                <td><font face="Helvetica, Arial, sans-serif"><small> Header
202 s.soni 1.1  for   the  provider implemented</small></font></td>
203                         </tr>
204                         <tr>
205 kumpf  1.2                <td><small><font face="Helvetica, Arial, sans-serif">&lt;ProviderNameMain.cpp&gt;</font>
206 s.soni 1.1           </small></td>
207                           <td><font face="Helvetica, Arial, sans-serif"><small> The
208            main()    function  calling the PegasusCreateProvider API</small></font></td>
209                         </tr>
210                         <tr>
211 kumpf  1.2                <td><font face="Helvetica, Arial, sans-serif"><small>&lt;Provider.mof&gt;</small></font>
212 s.soni 1.1           </td>
213                           <td><font face="Helvetica, Arial, sans-serif"><small> The
214            Sample    Class  MOF</small></font></td>
215                         </tr>
216                         <tr>
217 kumpf  1.2                <td><font face="Helvetica, Arial, sans-serif"><small>&lt;ProviderR.mof&gt;</small></font>
218 s.soni 1.1           </td>
219 kumpf  1.2                <td><font face="Helvetica, Arial, sans-serif"><small> Provider
220 s.soni 1.1   Registration   MOF.</small></font></td>
221                         </tr>
222 kumpf  1.2 
223              </tbody>
224 s.soni 1.1 </table>
225                     <small><font face="Helvetica, Arial, sans-serif"><br>
226                     The solution consists of test providers and test programs for the
227             following    specific conditions: [some parts of the actual code developed
228             are also provided   with the proposed solution for each of the specific
229 kumpf  1.2 scenarios]</font></small>
230 s.soni 1.1 <h3><small><font face="Helvetica, Arial, sans-serif">a.) Single Provider implementing
231            Multiple Classes<br>
232                     </font></small></h3>
233                     <small><font face="Helvetica, Arial, sans-serif"
234             color="#000000">This    test  program containing a sample provider is used
235            to test the provider  for  loading  multiple classes with various combinations
236            of the test client  to  fetch the  classes.</font><font
237             face="Helvetica, Arial, sans-serif"> Various  complex  client loading scenarios
238            are introduced in order to achieve this.<br>
239                     The following source programs are implemented for this test case:<br>
240                     1. TestProvider.mof defines 3 sample classes that implement the
241            TestProvider.cpp     source program. <br>
242 kumpf  1.2          2. The registration mof TestProviderR.mof registers the TestProvider
243 s.soni 1.1   in  the  root/SampleProvider namespace.<br>
244                     3. TestProvider.cpp is the actual provider module code.<br>
245 kumpf  1.2          4. TestProviderMain.cpp is the main program calling the TestProvider
246 s.soni 1.1   through   PegasusCreateProvider call.<br>
247                     5. A client script containing the commands for running CLI with
248            the   possible   CIM operations for the classes implemented by the provider.<br>
249 kumpf  1.2          6. Scripts for deleting provider module and restarting the cimserver
250 s.soni 1.1   are   also written for simplifying the test execution.<br>
251                     <br>
252                     A TestProvider is implemented for handling multiple classes. This
253             provider    also contains the code for testing the exception handling explained
254             in the   solution b) below. This exception handling test is present inside
255 kumpf  1.2  conditional    macros to enable/disable it.</font></small>
256            <h3><small><font face="Helvetica, Arial, sans-serif">b) Exception handling
257 s.soni 1.1     by Providers<br>
258                     </font></small></h3>
259                     <small><font face="Helvetica, Arial, sans-serif"
260             color="#000000">Exception     handling by the cimom when all types of exceptions
261            are thrown from within     the provider methods. A sample provider will be
262            used to throw exceptions     at different points in the execution of its
263            methods (like enumInstances,    enumInstNames  etc.)<br>
264                     <br>
265                     The provider contains the following code macro for enabling and
266            disabling     the exception handling tests in the provider<br>
267                     <br>
268                     </font><font face="Helvetica, Arial, sans-serif">// The following
269             macro   is  enabled/ disabled by setting TEST_EXCEPTIONS in the Makefile.<br>
270                     </font><font face="Helvetica, Arial, sans-serif" size="-1"><small><br>
271                     <big><b>TestProvider.cpp</b></big></small></font><big><font
272             face="Helvetica, Arial, sans-serif" size="-1"><big><br>
273                     ....<br>
274                     </big></font><font face="Helvetica, Arial, sans-serif"
275             size="-1">#ifdef     TEST_EXCEPTIONS<br>
276 kumpf  1.2          #define PEGASUS_EXCEPTION    PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
277 s.soni 1.1   "TestProvider   Exception")<br>
278 kumpf  1.2          #define CIM_EXCEPTION               CIMException(CIM_ERR_FAILED,
279 s.soni 1.1 "Test    Provider")<br>
280                     #else<br>
281 kumpf  1.2          #define PEGASUS_EXCEPTION // These can be defined at the compilation
282 s.soni 1.1   time   in the Makefile.<br>
283                     #define CIM_EXCEPTION<br>
284                     #endif<br>
285                     <br>
286 kumpf  1.2          // Update the value of the following macro for enabling/ disabling
287 s.soni 1.1  exceptions.<br>
288                     //<br>
289                     #define EXCEPTION_TYPE      0<br>
290                     <br>
291 kumpf  1.2          #define CheckExceptionType(X)                  {                  
292 s.soni 1.1  \<br>
293                                     if (X == 1) throw PEGASUS_EXCEPTION;    \<br>
294                                     if (X == 2) throw CIM_EXCEPTION;               \<br>
295                                     }<br>
296                  <br>
297                     </font></big><font face="Helvetica, Arial, sans-serif">The normal
298             working    of the provider is unaffected if the TEST_EXCEPTIONS flag is
299            not  set during    the compilation.<br>
300 kumpf  1.2          </font></small>
301            <h3><small><font face="Helvetica, Arial, sans-serif">c) Provider load/unload
302 s.soni 1.1     and Timing<br>
303                     </font></small></h3>
304                     <small><font face="Helvetica, Arial, sans-serif">Written a sample
305             provider    in which multiple sleep points are introduced at various points
306             in the provider   method execution. The sleep durations can be different
307            for the different  provider methods.<br>
308 kumpf  1.2          Its an attempt to find out any inconsistencies in the provider load/unload
309                (if any) logic.The ideal test case requires that a provider unloads when
310               another client is invoking enumerate instances for a provider class and
311             vice  versa. It is quite difficult to create this kind of situation with
312            this set  of test programs. By running these tests for long hours we might
313            hit some  problem.</font></small>
314 s.soni 1.1 <ul>
315                       <li><small><font face="Helvetica, Arial, sans-serif">The provider
316              (TimingProvider.cpp)   implements the base class TimingSampleClass with
317            3  derived classes TimeOne,   TimeTwo, TimeThree.</font></small></li>
318 kumpf  1.2            <li><small><font face="Helvetica, Arial, sans-serif">The instances
319              of  the  TimeOne and TimeTwo classes are created inside the TimingProvider:initialize
320 s.soni 1.1     method in the provider.</font></small></li>
321 kumpf  1.2            <li><small><font face="Helvetica, Arial, sans-serif">Scripts are
322             provided    to build, load and execute the provider programs as well running
323 s.soni 1.1  the client    programs and scripts.</font></small></li>
324 kumpf  1.2 
325 s.soni 1.1 </ul>
326 kumpf  1.2          <small><font face="Helvetica, Arial, sans-serif">The client programs
327 s.soni 1.1   include:<br>
328 kumpf  1.2          </font></small>
329 s.soni 1.1 <ul>
330 kumpf  1.2            <li><small><font face="Helvetica, Arial, sans-serif">Makefile.Client
331 s.soni 1.1    -  A separate Makefile to execute the client program.</font></small></li>
332 kumpf  1.2            <li><small><font face="Helvetica, Arial, sans-serif">TimingClient.cpp
333               -  This program tests the TimingProvider implemented by running multiple
334 s.soni 1.1   threads  performing different CIM operations.</font> <font
335 kumpf  1.2  face="Helvetica, Arial, sans-serif">main() forks and child calls EnumerateInstances
336                for one class. The parent make calls to EnumerateInstances and EnumerateClass.
337 s.soni 1.1     Long sleeps are inserted between the calls to enumerateinstances and enumerateClasses.</font></small></li>
338 kumpf  1.2            <li><small><font face="Helvetica, Arial, sans-serif">Client script
339              -  This  script contains the combination of TimingClient and CLI client
340            programs   with  random sleeps inserted between them.CLI is used to enumerate
341            instances/   instancenames  and enumerate classes for the root/SampleProvider
342 s.soni 1.1 namespace   created by the  test provider.</font></small></li>
343 kumpf  1.2 
344 s.soni 1.1 </ul>
345                     <font size="-1"><font face="Helvetica, Arial, sans-serif">From <b>TimingClient.cpp</b><br>
346                     .....<br>
347                     int main(int argc, char** argv)<br>
348                     {<br>
349                         pid_t pid;<br>
350                         try<br>
351                         {<br>
352                             CIMClient client;<br>
353                     <br>
354                             client.connect("localhost", 5988, "", "");<br>
355                     <br>
356                             if ((pid = fork()) &lt; 0)<br>
357                             {<br>
358                                     cout &lt;&lt; "Fork Error\n" &lt;&lt; endl;<br>
359                                     exit(0);<br>
360                             }<br>
361                             else if (pid == 0)<br>
362                             {   // child<br>
363                                 sleep(10);<br>
364                                 EnumerateInstancesTiming(client, CLASSONE);<br>
365 s.soni 1.1                      _exit(0);<br>
366                             }<br>
367                             // parent<br>
368                             sleep(10);<br>
369                             EnumerateInstancesTiming(client, CLASSTWO);<br>
370                             sleep(5);<br>
371                             EnumerateClassesTiming(client, "TimingSampleClass");<br>
372                         }<br>
373                         catch(Exception&amp; e)<br>
374                         {<br>
375 kumpf  1.2                  PEGASUS_STD(cerr) &lt;&lt; "Error: " &lt;&lt; e.getMessage()
376 s.soni 1.1   &lt;&lt;<br>
377                                 PEGASUS_STD(endl);<br>
378                             exit(1);<br>
379                         }<br>
380                     }<br>
381 kumpf  1.2          </font></font>
382            <h3><small><font face="Helvetica, Arial, sans-serif">d) Resource sharing,
383 s.soni 1.1     multithreading and Inheritance in provider methods.<br>
384                     </font></small></h3>
385                     <small><font face="Helvetica, Arial, sans-serif">Doing a fork()
386 kumpf  1.2 from   inside   the provider methods and examining the file descriptors inherited
387              by the  sub-processes. To handle Linux threading cleanly, the sample provider
388              thread  spawn a reaper thread whose sole purpose is to wait for the subprocess
389 s.soni 1.1   to  terminate.<br>
390                     <br>
391                     The implementation is done by creating a sample provider in the
392 kumpf  1.2 following     manner:</font></small>
393 s.soni 1.1 <ol>
394 kumpf  1.2            <li><small><font face="Helvetica, Arial, sans-serif">MultithreadingSampleProviderMain.cpp
395 s.soni 1.1     is the source file which contains the provider entry point routine.</font></small></li>
396 kumpf  1.2            <li><small><font face="Helvetica, Arial, sans-serif">MultithreadingSampleProvider.cpp
397 s.soni 1.1     [h] are the main provider sources that implement the MultithreadingSampleClass.</font></small></li>
398                       <li><small><font face="Helvetica, Arial, sans-serif">The Base
399            class    has  3 derived classes called ThreadSampleOne, ThreadSampleTwo and
400            ThreadSampleThree.</font></small></li>
401 kumpf  1.2            <li><small><font face="Helvetica, Arial, sans-serif">ThreadSampleOne
402               class  instances are created inside the enumerateInstances method of the
403              provider.  After the instances creation this method calls explicitly the
404 s.soni 1.1  CreateThread  function, which spawns a new sub-process and executes the command
405             line cim  client CLI.</font></small></li>
406                       <li><small><font face="Helvetica, Arial, sans-serif">The additional
407               functions  added in the provider source program other than the standard
408             provider  methods  are:</font></small></li>
409 kumpf  1.2 
410 s.soni 1.1   <ol>
411 kumpf  1.2              <li><small><font face="Helvetica, Arial, sans-serif">CreateThread()
412 s.soni 1.1    -  Function creating the sub-process (by using fork())</font></small></li>
413                         <li><small><font face="Helvetica, Arial, sans-serif">reader()
414             -  child   process reads from the input stream</font></small></li>
415                         <li><small><font face="Helvetica, Arial, sans-serif">writer()
416             -  Parent   process writing to the output stream<br>
417                           </font></small></li>
418 kumpf  1.2 
419 s.soni 1.1   </ol>
420                       <li><small><font face="Helvetica, Arial, sans-serif">The parent
421             process    after writing to the output stream sleeps in the function writer()
422             which   makes the CLI command give a timeout error.</font></small></li>
423 kumpf  1.2            <li><small><font face="Helvetica, Arial, sans-serif">Scripts are
424             created    for building the source and repository and for registering  the
425 s.soni 1.1  provider.</font></small></li>
426 kumpf  1.2 
427 s.soni 1.1 </ol>
428 kumpf  1.2          <font face="Helvetica, Arial, sans-serif"><small>From <b>MultithreadingSampleProvider.cpp
429 s.soni 1.1     </b>[ CreateThreads() function is illustrated below]:<br>
430                     </small></font><small><font face="Helvetica, Arial, sans-serif">....<br>
431                     <br>
432                   <font size="-1">  int CreateThreads()<br>
433                     {<br>
434                         char* arg_list[] = {<br>
435                                 "CLI",<br>
436                                 "niall",<br>
437                                 "-n",<br>
438                                 "root/SampleProvider",<br>
439                                 NULL<br>
440                         };<br>
441                         int fds[2];<br>
442                         pid_t cpid;<br>
443                   <br>
444                         pipe(fds);<br>
445                   <br>
446                         cpid = fork();<br>
447                         if (cpid == (pid_t)0)<br>
448                         {<br>
449                             FILE* stream;<br>
450 s.soni 1.1                  // This is the child process. Close our copy of the write
451             end<br>
452                             // of the file descriptor.<br>
453                             close(fds[1]);<br>
454                             // Connect the read end of the pipe to standard input.<br>
455                             dup2(fds[0], STDIN_FILENO);<br>
456                             // Convert the read file descriptor to a FILE object, and
457             read   from  it<br>
458                             stream = fdopen(fds[0],"r" );<br>
459                             reader(stream);<br>
460                             close(fds[0]);<br>
461                             // Replace the child process with the CLI program<br>
462                             execvp ("CLI", arg_list);<br>
463                         }<br>
464                         else<br>
465                         {<br>
466                             FILE* stream;<br>
467                             // Close our copy of the read end of the file descriptor.<br>
468                             close (fds[0]);<br>
469                             // Convert the write file descriptor to a FILE object,and
470             write    to it.<br>
471 s.soni 1.1                  stream = fdopen(fds[1],"w" );<br>
472                   <br>
473                             writer("Test Writer from Parent process\n", 2, stream);<br>
474                   </font>        </font><font face="Helvetica, Arial, sans-serif"
475             size="-1">        close (fds[1]);<br>
476                             // Wait for child process to finish<br>
477                             waitpid(cpid, NULL, 0);</font></small><font size="-1"><br>
478                       </font><small><font face="Helvetica, Arial, sans-serif"><font
479             size="-1">  }<br>
480                         return 0;<br>
481                     }<br>
482                     ....<br>
483                     ....</font><br>
484 kumpf  1.2          </font></small>
485 s.soni 1.1 <h3><small><font face="Helvetica, Arial, sans-serif">e) CIMOMHandle and OperationContext</font></small></h3>
486 kumpf  1.2          <small><font face="Helvetica, Arial, sans-serif">A sample provider
487             exercising    the CIMOMHandle that sets the UserIdentity into OperationContext.
488             The provider    method modifies the user identity in the OperationContext
489 s.soni 1.1  to check the cimom   behavior.<br>
490                     <br>
491                     The CIMOMSample provider modifies the user identity in its methods.
492 kumpf  1.2   Then   a client is executed with different combinations of the user/ password
493 s.soni 1.1   information   for checking provider behavior.<br>
494                     <br>
495                     Client scripts are written for <br>
496                         1) Adding users to be authorised for accessing a particular
497            namespace     [using "cimauth"]  <br>
498 kumpf  1.2              2) Trying to access the namespace with valid/invalid user/passwd
499 s.soni 1.1   information   ["cimuser" is used to verify the users present]<br>
500                     <br>
501 kumpf  1.2          </font></small>
502            <h3><small><font face="Helvetica, Arial, sans-serif">f) XML Parser/ Generator
503 s.soni 1.1     verification for Malformed property strings<br>
504                     </font></small></h3>
505                     <small><font face="Helvetica, Arial, sans-serif">Checking the XML
506             parser    and generator programs when malformed strings are passed through
507             the providers.    The malformed property strings can be anything from trailing
508             NULs to any   special characters and angle brackets. A sample provider is
509             written which   introduces bad strings while creating the instances of the
510             sample class.  These property strings are verified from inside the provider
511             methods to verify  if the provider receives the proper XML encoded string
512             and not any junk characters.<br>
513                     <br>
514 kumpf  1.2          The test provider is written for testing the following 3 cases regarding
515 s.soni 1.1     data handling:</font></small><small><font
516             face="Helvetica, Arial, sans-serif"><br>
517 kumpf  1.2          </font></small>
518 s.soni 1.1 <ul>
519                       <li><small><font face="Helvetica, Arial, sans-serif">Trailing
520            nul,   did   you verify that the provider actually saw the nul character
521            rather  than the  URL escape sequence?  For example, the provider should
522            see {'a',  ..., \0'},  not {'a', ..., '\\', '0', '0', '0'}.</font></small></li>
523                       <li><small><font face="Helvetica, Arial, sans-serif">Trailing
524            angle    brackets  '&lt;', '&gt;'</font></small></li>
525                       <li><small><font face="Helvetica, Arial, sans-serif">Trailing
526            spaces    and  special characters.</font></small></li>
527 kumpf  1.2 
528 s.soni 1.1 </ul>
529 kumpf  1.2 
530            <h3><small><font face="Helvetica, Arial, sans-serif">g) Large Data Handling
531 s.soni 1.1     by the provider<br>
532                     </font></small></h3>
533 kumpf  1.2          <small><font face="Helvetica, Arial, sans-serif">A sample provider
534             implementing    a class with large number of instances. The number of instances
535             can be controlled   through a compilation time configuration variable. Changing
536 s.soni 1.1  the number of   instances the provider can be tested for large data handling.<br>
537                     <br>
538                     There is a const macro NO_OF_INSTANCES which decides the number
539 kumpf  1.2 of  instances    to be created. This can be modified for testing huge amount
540 s.soni 1.1 of data in 2  places. Either in the source file LargeDataProvider.cpp Or in
541 kumpf  1.2 the Makefile   by defining the NO_OF_INSTANCES locally (LOCAL_DEFINES=-DNO_OF_INSTANCES=&lt;number&gt;).
542                If it is defined inside the Makefile, the value present in the cpp source
543 s.soni 1.1     is overwritten.<br>
544                     </font><font face="Helvetica, Arial, sans-serif" size="-1"><small><br>
545                  </small></font></small><font face="Helvetica, Arial, sans-serif"
546             size="-1">   from <b>LargeDataProvider.cpp<br>
547                     </b>......<b><br>
548                     </b>#ifndef NO_OF_INSTANCES<br>
549                         #define NO_OF_INSTANCES 100<br>
550                     #endif<br>
551                     </font><font face="Helvetica, Arial, sans-serif" size="-1">......</font><font
552             face="Helvetica, Arial, sans-serif" size="-1"><br>
553                     <br>
554                     </font><font face="Helvetica, Arial, sans-serif" size="-1">from
555            <b>Makefile</b></font><font face="Helvetica, Arial, sans-serif"
556             size="-1"><br>
557 kumpf  1.2          </font><font face="Helvetica, Arial, sans-serif" size="-1">NO_OF_INSTANCES
558 s.soni 1.1     = 100 # The number of instances can be changed here<br>
559                     </font><font face="Helvetica, Arial, sans-serif" size="-1">......</font><font
560             face="Helvetica, Arial, sans-serif" size="-1"><br>
561                  <br>
562                     </font><small><font face="Helvetica, Arial, sans-serif">   The creation
563               of Instances is done when the enumerateInstances method of the  provider
564              is called.If a client requests for enumerateInstanceNames it will  fail
565 kumpf  1.2 if  enumerateInstances wouldn't have been executed. </font></small>
566            
567 s.soni 1.1 <h3> </h3>
568 kumpf  1.2 
569 s.soni 1.1 <h3><small><font face="Helvetica, Arial, sans-serif">f) Load MOFs</font></small></h3>
570 kumpf  1.2          <small><font face="Helvetica, Arial, sans-serif">The MOF files for
571             all   the  sample providers developed above are present in a common directory
572             LoadMOF/.   The directory structure is taken from the $PEGASUS_HOME/src/Providers/sample
573               directory  inside the pegasus source tree. Makefile in LoadMOF is responsible
574               for compiling  all the classes and registering the sample providers. Unregistering
575               of providers  is also supported by introducing a "unregister" target in
576 s.soni 1.1  the  LoadMOF/Makefile.  This unregister and deletes the provider loaded by
577             it.  <br>
578 kumpf  1.2        The user has to run  "make repository" again in order to compile the
579             provider   classes and to re-register  the provider.</font></small>
580            
581 s.soni 1.1 <h2><small><font face="Helvetica, Arial, sans-serif" color="#000000">Rationale</font></small></h2>
582                    <small><font face="Helvetica, Arial, sans-serif"> Improved test coverage
583                for Pegasus</font></small><br>
584 kumpf  1.2 
585 s.soni 1.1 <h2><small><font face="Helvetica, Arial, sans-serif" color="#000000">Schedule</font></small></h2>
586 kumpf  1.2 
587 s.soni 1.1 <p><small><font face="Helvetica, Arial, sans-serif">The goal is to get this
588                functionality in 2.3.2 or very early in the 2.4 main branch. [The first
589              code  drop for the test programs mentioned in this PEP is available now
590            and  can  be committed anytime].<br>
591                    </font></small></p>
592 kumpf  1.2 
593 s.soni 1.1 <table cellpadding="2" cellspacing="2" border="1"
594             style="text-align: left; width: 100%;">
595                       <tbody>
596                         <tr>
597                           <td style="vertical-align: top;" bgcolor="#cccccc"><font
598             face="Helvetica, Arial, sans-serif"><small>action<br>
599                           </small></font></td>
600                           <td style="vertical-align: top;" bgcolor="#cccccc"><font
601             face="Helvetica, Arial, sans-serif"><small>planned<br>
602                           </small></font></td>
603                           <td style="vertical-align: top;" bgcolor="#cccccc"><font
604             face="Helvetica, Arial, sans-serif"><small>actual<br>
605                           </small></font></td>
606                           <td style="vertical-align: top;" bgcolor="#cccccc"><font
607             face="Helvetica, Arial, sans-serif"><small>comment<br>
608                           </small></font></td>
609                         </tr>
610                          <tr>
611                           <td style="vertical-align: top;"><font
612             face="Helvetica, Arial, sans-serif"><small>PEP submitted<br>
613                           </small></font></td>
614 s.soni 1.1                <td style="vertical-align: top;"><font
615             face="Helvetica, Arial, sans-serif"><small>12/24/2003<br>
616                           </small></font></td>
617                           <td style="vertical-align: top;"><font
618             face="Helvetica, Arial, sans-serif"><small>12/24/2003<br>
619                           </small></font></td>
620                           <td style="vertical-align: top;"><font
621             face="Helvetica, Arial, sans-serif"><small><br>
622                           </small></font></td>
623                         </tr>
624                         <tr>
625                           <td style="vertical-align: top;"><font
626             face="Helvetica, Arial, sans-serif"><small>PEP reviewed<br>
627                           </small></font></td>
628                           <td style="vertical-align: top;"><font
629             face="Helvetica, Arial, sans-serif"><small>02/03/2004</small></font></td>
630                   <td style="vertical-align: top;"><font
631             face="Helvetica, Arial, sans-serif"><small>02/03/2004<br>
632                           </small></font></td>
633                           <td style="vertical-align: top;"><font
634             face="Helvetica, Arial, sans-serif"><small><br>
635 s.soni 1.1                </small></font></td>
636                         </tr>
637                         <tr>
638                           <td style="vertical-align: top;"><font
639             face="Helvetica, Arial, sans-serif"><small>PEP approved<br>
640                           </small></font></td>
641                           <td style="vertical-align: top;"><font
642             face="Helvetica, Arial, sans-serif"><small>02/03/2004<br>
643                           </small></font></td>
644                           <td style="vertical-align: top;"><font
645             face="Helvetica, Arial, sans-serif"><small>02/03/2004<br>
646                           </small></font></td>
647                           <td style="vertical-align: top;"><font
648             face="Helvetica, Arial, sans-serif"><small><br>
649                           </small></font></td>
650                         </tr>
651                         <tr>
652                           <td style="vertical-align: top;"><font
653             face="Helvetica, Arial, sans-serif"><small>Code committed<br>
654                           </small></font></td>
655                           <td style="vertical-align: top;"><font
656 s.soni 1.1  face="Helvetica, Arial, sans-serif"><small><br>
657                           </small></font></td>
658                           <td style="vertical-align: top;"><font
659             face="Helvetica, Arial, sans-serif"><small><br>
660                           </small></font></td>
661                           <td style="vertical-align: top;"><font
662             face="Helvetica, Arial, sans-serif"><small>The changes can be committed in
663            a day after the PEP is approved.<br>
664                           </small></font></td>
665                         </tr>
666 kumpf  1.2 
667              </tbody>
668 s.soni 1.1 </table>
669 kumpf  1.2 
670 s.soni 1.1 <h2><small><font face="Helvetica, Arial, sans-serif" color="#000000">Discussion</font></small></h2>
671            <small><font face="Helvetica, Arial, sans-serif">The PEP was not balloted,
672 kumpf  1.2 as per the agreement of the Pegasus Architecture team.</font></small>
673            
674 s.soni 1.1 <p><small><font face="Helvetica, Arial, sans-serif" color="#0000ff"></font></small></p>
675 kumpf  1.2 
676 s.soni 1.1 <hr><br>
677            <br>
678 kumpf  1.2 
679            <p><small><font face="Helvetica, Arial, sans-serif"><i><font size="2"><small>Copyright
680                (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; IBM
681 s.soni 1.1 Corp.;   The Open Group</small></font><br>
682                     <br>
683                     <font size="1"><small>Permission is hereby granted, free of charge,
684 kumpf  1.2   to  any person obtaining a copy  of this software and associated documentation
685               files (the "Software"), to deal in the Software without restriction, including
686               without limitation the rights to use, copy, modify, merge, publish, distribute,
687 s.soni 1.1    sublicense, and/or sell copies of the Software, and to permit persons to
688              whom the Software is furnished to do so, subject to the following conditions:</small></font><br>
689                     <font size="2"><small><br>
690 kumpf  1.2          </small></font> <font size="1"><small>THE ABOVE COPYRIGHT NOTICE
691            AND   THIS   PERMISSION NOTICE SHALL BE INCLUDED IN ALL COPIES OR SUBSTANTIAL
692            PORTIONS    OF THE SOFTWARE. THE SOFTWARE IS PROVIDED  "AS IS", WITHOUT WARRANTY
693            OF  ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
694              OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
695              IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
696              DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
697              ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
698 s.soni 1.1   DEALINGS IN THE SOFTWARE.</small></font></i></font></small></p>
699 kumpf  1.2 
700 s.soni 1.1 <p><small><font face="Helvetica, Arial, sans-serif"> </font></small></p>
701                     <small><font face="Helvetica, Arial, sans-serif"><br>
702                     <br>
703                     <br>
704                     </font></small> <br>
705                    <br>
706                   <br>
707                  <br>
708                 <br>
709                <br>
710               <br>
711              <br>
712             <br>
713            </body>
714            </html>

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2