コード例 #1
0
/**
   _validateKeys method of the OS provider Test Client
  */
void OSTestClient::_validateKeys(CIMObjectPath &cimRef, 
                                 Boolean verboseTest)
{
   // don't have a try here - want it to be caught by caller

   Array<CIMKeyBinding> keyBindings = cimRef.getKeyBindings();

   if (verboseTest)
      cout << "Retrieved " << keyBindings.size() << " keys" <<endl;

   for (Uint32 j = 0; j < keyBindings.size(); j++)
   {
      CIMName keyName = keyBindings[j].getName();
      if (verboseTest)
         cout << "checking key " << keyName << endl;
      if (((keyName.equal ("CSCreationClassName")) &&
          (goodCSCreationClassName(
               keyBindings[j].getValue(),
               verboseTest) == false))) 
      {
         errorExit ("CSCreationClassName not CIM_UnitaryComputerSystem");
      }
      else if ((keyName.equal ("CSName")) &&
               (goodCSName(keyBindings[j].getValue(),
                       verboseTest) == false))
      { 
         errorExit ("CSName not correct");
      }
      else if ((keyName.equal ("CreationClassName")) &&
          (goodCreationClassName( 
            keyBindings[j].getValue(),
            verboseTest) == false))
      { 
         errorExit ("CreationClassName not correct");
      }
      else if ((keyName.equal ("Name")) &&
                (goodName( 
                  keyBindings[j].getValue(),
                  verboseTest) == false))
      { 
         errorExit ("Name not correct");
      }
    }  // end for j looping through properties
}
コード例 #2
0
ファイル: NISTestClient.cpp プロジェクト: deleisha/neopegasus
/**
   _validateKeys method of the NIS provider Test Client
  */
void NISTestClient::_validateKeys(
    CIMObjectPath &cimRef,
    Boolean verboseTest)
{
    // don't have a try here - want it to be caught by caller
    String keyVal;
    CIMName keyName;
    Array<CIMKeyBinding> keyBindings = cimRef.getKeyBindings();

    if (verboseTest)
        cout << "Retrieved " << keyBindings.size() << " keys" <<endl;

    for (Uint32 j = 0; j < keyBindings.size(); j++)
    {
        keyName = keyBindings[j].getName();
        keyVal = keyBindings[j].getValue();
        if (verboseTest)
            cout << "checking key " << keyName.getString() << endl;

        if (keyName.equal("CreationClassName") &&
            !goodCreationClassName(keyVal, verboseTest))
        {
            errorExit ("CreationClassName not PG_NISServerService");
        }
        else if (keyName.equal("Name") &&
                 !goodName(keyVal, verboseTest))
        {
            errorExit ("Name not correct");
        }
        else if (keyName.equal("SystemCreationClassName") &&
                 !goodSystemCreationClassName(keyVal, verboseTest))
        {
            errorExit ("SystemCreationClassName not correct");
        }
        else if (keyName.equal("SystemName") &&
                 !goodSystemName(keyVal, verboseTest))
        {
            errorExit ("SystemName not correct");
        }
    }
}
コード例 #3
0
ファイル: NISTestClient.cpp プロジェクト: deleisha/neopegasus
/**
   _validateProperties method of the NIS provider Test Client
  */
void NISTestClient::_validateProperties(
    CIMInstance &inst,
    Boolean verboseTest)
{
    if (verboseTest)
        cout << "Checking " << inst.getPropertyCount() << " properties" << endl;

    // loop through the properties
    for (Uint32 j=0; j < inst.getPropertyCount(); j++)
    {
        CIMName propertyName = inst.getProperty(j).getName();

        if (verboseTest)
            cout << "Property name: " << propertyName.getString() << endl;

        if (propertyName.equal("CreationClassName"))
        {
            String propertyValue;
            inst.getProperty(j).getValue().get(propertyValue);
            if (goodCreationClassName(propertyValue, verboseTest) == false)
            {
                errorExit ("CreationClassName not PG_NISServerService");
            }
        }  // end if CreationClassName
        else if (propertyName.equal("Name"))
        {
            String propertyValue;
            inst.getProperty(j).getValue().get(propertyValue);
            if (goodName(propertyValue, verboseTest) == false)
            {
                errorExit ("Name not correct");
            }
        }  // end if Name

        else if (propertyName.equal("Caption"))
        {
            String propertyValue;
            inst.getProperty(j).getValue().get(propertyValue);
            if (goodCaption(propertyValue, verboseTest) == false)
            {
                errorExit ("Caption not correct");
            }
        }  // end if Caption

        else if (propertyName.equal("Description"))
        {
            String propertyValue;
            inst.getProperty(j).getValue().get(propertyValue);
            if (goodDescription(propertyValue, verboseTest) == false)
            {
                errorExit ("Description not correct");
            }
        }  // end if Description

        else if (propertyName.equal("ServerWaitFlag"))
        {
            Uint16 propertyValue;
            inst.getProperty(j).getValue().get(propertyValue);
            if (goodServerWaitFlag(propertyValue, verboseTest) == false)
            {
                errorExit ("ServerWaitFlag not correct");
            }
        }  // end if Server Wait Flag

        else if (propertyName.equal("ServerType"))
        {
            Uint16 propertyValue;
            inst.getProperty(j).getValue().get(propertyValue);
            if (goodServerType(propertyValue, verboseTest) == false)
            {
                errorExit ("ServerType not correct");
            }
        }  // end if Server Wait Flag

        else if (propertyName.equal("SystemName"))
        {
            String propertyValue;
            inst.getProperty(j).getValue().get(propertyValue);
            if (goodSystemName(propertyValue, verboseTest) == false)
            {
                errorExit ("SystemName not correct");
            }
        }  // end if SystemName
        else if (propertyName.equal("SystemCreationClassName"))
        {
            String propertyValue;
            inst.getProperty(j).getValue().get(propertyValue);
            if (goodSystemCreationClassName(propertyValue, verboseTest) ==
                    false)
            {
                errorExit ("SystemCreationClassName not correct");
            }
        }  // end if SystemCreationClassName
    }
}
コード例 #4
0
/**
   _validateProperties method of the OS provider Test Client
  */
void OSTestClient::_validateProperties(CIMInstance &inst, 
                                       Boolean verboseTest)
{
   // don't have a try here - want it to be caught by caller

   if (verboseTest)
      cout << "Checking " <<inst.getPropertyCount()<<" properties"<<endl;

   // loop through the properties
   for (Uint32 j=0; j < inst.getPropertyCount(); j++)
   {
      CIMName propertyName = inst.getProperty(j).getName();
      if (propertyName.equal ("CSCreationClassName"))
      {
         String propertyValue;
         inst.getProperty(j).getValue().get(propertyValue);
         if (goodCSCreationClassName(propertyValue,
             verboseTest) == false)
         { 
            errorExit ("CSCreationClassName not CIM_UnitaryComputerSystem");
         }
      } // end if CSCreationClassName

      else if (propertyName.equal ("CSName"))
      {
         String propertyValue;
         inst.getProperty(j).getValue().get(propertyValue); 
         if (goodCSName(propertyValue, verboseTest) == false)
         {
            errorExit ("CSName not correct");
         }
      }  // end if CSName

      else if (propertyName.equal ("CreationClassName"))
      {
         String propertyValue;
         inst.getProperty(j).getValue().get(propertyValue); 
         if (goodCreationClassName(propertyValue, 
                                   verboseTest) == false)
         { 
            errorExit ("CreationClassName not CIM_OperatingSystem");
         }
      }  // end if CreationClassName
      else if (propertyName.equal ("Name"))
      {
         String propertyValue;
         inst.getProperty(j).getValue().get(propertyValue); 
         if (goodName(propertyValue, verboseTest) == false) 
         { 
            errorExit ("Name not correct");
         }
      }  // end if Name

      else if (propertyName.equal ("Caption"))
      {
         String propertyValue;
         inst.getProperty(j).getValue().get(propertyValue); 
         if (goodCaption(propertyValue, verboseTest) == false) 
         { 
            errorExit ("Caption not correct");
         }
      }   // end if Caption

      else if (propertyName.equal ("Description")) 
      {
         String propertyValue;
         inst.getProperty(j).getValue().get(propertyValue); 
         if (goodDescription(propertyValue, verboseTest) == false) 
         { 
            errorExit ("Description not correct");
         }
      }   // end if Description

      else if (propertyName.equal ("InstallDate")) 
      {
         CIMDateTime idate;
         inst.getProperty(j).getValue().get(idate);
         if (goodInstallDate(idate, verboseTest) == false) 
         { 
            errorExit ("InstallDate not correct");
         }
      }   //  end if InstallDate

      else if (propertyName.equal ("Status"))
      { 
         String propertyValue;
         inst.getProperty(j).getValue().get(propertyValue);
         if (goodStatus(propertyValue, verboseTest) == false)
         { 
            errorExit ("Status not correct");
         }
      }   // end if Status

      else if (propertyName.equal ("OSType"))
      {
         Uint16 ostype;
         inst.getProperty(j).getValue().get(ostype);
         if (goodOSType(ostype, verboseTest) == false)
         { 
            errorExit ("OSType not correct");
         }
      }   // end if OSType

      else if (propertyName.equal ("OtherTypeDescription"))
      {
         String propertyValue;
         inst.getProperty(j).getValue().get(propertyValue);
         if (goodOtherTypeDescription(propertyValue, 
                                      verboseTest) == false)
         { 
            errorExit ("OtherTypeDescription not correct");
         }
      }   // end if OtherTypeDescription

      else if (propertyName.equal ("Version"))
      {
         String propertyValue;
         inst.getProperty(j).getValue().get(propertyValue);
         if (goodVersion(propertyValue, verboseTest) == false)
         { 
            errorExit ("Version not correct");
         }
      }   // end if Version

      else if (propertyName.equal ("LastBootUpTime"))
      {
         CIMDateTime bdate;
         inst.getProperty(j).getValue().get(bdate);
         if (goodLastBootUpTime(bdate, verboseTest) == false) 
         { 
            errorExit ("LastBootUpTime not correct");
         }
      }   // end if LastBootUpTime
 
      else if (propertyName.equal ("LocalDateTime"))
      {
         CIMDateTime ldate;
         inst.getProperty(j).getValue().get(ldate);
         if (goodLocalDateTime(ldate, verboseTest) == false) 
         { 
            errorExit ("LocalDateTime not correct");
         }
      }   // end if LocalDateTime

      else if (propertyName.equal ("CurrentTimeZone"))
      {
         Sint16 tz;
         inst.getProperty(j).getValue().get(tz);
         if (goodCurrentTimeZone(tz, verboseTest) == false)
         { 
            errorExit ("CurrentTimeZone not correct");
         }
      }   // end if CurrentTimeZone
 
      else if (propertyName.equal ("NumberOfLicensedUsers"))
      {
         Uint32 numlusers;
         inst.getProperty(j).getValue().get(numlusers);
         if (goodNumberOfLicensedUsers(numlusers, 
                                       verboseTest) == false)
         { 
            errorExit ("NumberOfLicensedUsers not correct");
         }
      }   // end if numberOfLicensedUsers
 
      else if (propertyName.equal ("NumberOfUsers"))
      {
         Uint32 numUsers;
         inst.getProperty(j).getValue().get(numUsers);
         if (goodNumberOfUsers(numUsers, 
                               verboseTest) == false)
         { 
            errorExit ("NumberOfUsers not correct");
         }
      }   // end if NumberOfUsers

      else if (propertyName.equal ("NumberOfProcesses"))
      {
         Uint32 numProcs;
         inst.getProperty(j).getValue().get(numProcs);
         if (goodNumberOfProcesses(numProcs,
                               verboseTest) == false)
         { 
            errorExit ("NumberOfProcesses not correct");
         }
      }   // end if NumberOfProcesses 
      
      else if (propertyName.equal ("MaxNumberOfProcesses"))
      {
         Uint32 maxProcs;
         inst.getProperty(j).getValue().get(maxProcs);
         if (goodMaxNumberOfProcesses(maxProcs,
                               verboseTest) == false)
         { 
            errorExit ("MaxNumberOfProcesses not correct");
         }
      }   // end if MaxNumberOfProcesses 

      else if (propertyName.equal ("TotalSwapSpaceSize"))
      {
         Uint64 totalSwap;
         inst.getProperty(j).getValue().get(totalSwap);
         if (goodTotalSwapSpaceSize(totalSwap,
                                    verboseTest) == false)
         { 
            errorExit ("TotalSwapSpaceSize not correct");
         }
      }   // end if TotalSwapSpaceSize

      else if (propertyName.equal ("TotalVirtualMemorySize"))
      {
         Uint64 totalVmem;
         inst.getProperty(j).getValue().get(totalVmem);
         if (goodTotalVirtualMemorySize(totalVmem,
                                    verboseTest) == false)
         { 
            errorExit ("TotalVirtualMemorySize not correct");
         }
      }   // end if TotalVirtualMemorySize

      else if (propertyName.equal ("FreeVirtualMemory"))
      {
         Uint64 freeVmem;
         inst.getProperty(j).getValue().get(freeVmem);
         if (goodFreeVirtualMemory(freeVmem,
                                   verboseTest) == false)
         { 
            errorExit ("FreeVirtualMemory not correct");
         }
      }   // end if FreeVirtualMemory

      else if (propertyName.equal ("FreePhysicalMemory"))
      {
         Uint64 freePmem;
         inst.getProperty(j).getValue().get(freePmem);
         if (goodFreePhysicalMemory(freePmem,
                                   verboseTest) == false)
         { 
            errorExit ("FreePhysicalMemory not correct");
         }
      }   // end if FreePhysicalMemory

      else if (propertyName.equal ("TotalVisibleMemorySize"))
      {
         Uint64 totalVisMem;
         inst.getProperty(j).getValue().get(totalVisMem);
         if (goodTotalVisibleMemorySize(totalVisMem,
                                        verboseTest) == false)
         { 
            errorExit ("TotalVisibleMemorySize not correct");
         }
      }   // end if TotalVisibleMemorySize

      else if (propertyName.equal ("SizeStoredInPagingFiles"))
      {
         Uint64 propertyValue;
         inst.getProperty(j).getValue().get(propertyValue);
         if (goodSizeStoredInPagingFiles(propertyValue,
                                         verboseTest) == false)
         { 
            errorExit ("SizeStoredInPagingFiles not correct");
         }
      }   // end if SizeStoredInPagingFiles 

      else if (propertyName.equal ("FreeSpaceInPagingFiles"))
      {
         Uint64 propertyValue;
         inst.getProperty(j).getValue().get(propertyValue);
         if (goodFreeSpaceInPagingFiles(propertyValue,
                                        verboseTest) == false)
         { 
            errorExit ("FreeSpaceInPagingFiles not correct");
         }
      }   // end if FreeSpaceInPagingFiles 

      else if (propertyName.equal ("MaxProcessMemorySize"))
      {
         Uint64 propertyValue;
         inst.getProperty(j).getValue().get(propertyValue);
         if (goodMaxProcessMemorySize(propertyValue,
                                        verboseTest) == false)
         { 
            errorExit ("MaxProcessMemorySize not correct");
         }
      }   // end if MaxProcessMemorySize 

      else if (propertyName.equal ("Distributed"))
      {
         Boolean propertyValue;
         inst.getProperty(j).getValue().get(propertyValue);
         if (goodDistributed(propertyValue,
                             verboseTest) == false)
         { 
            errorExit ("Distributed not correct");
         }
      }   // end if Distributed 

      else if (propertyName.equal ("MaxProcessesPerUser"))
      {
         Uint32 propertyValue;
         inst.getProperty(j).getValue().get(propertyValue);
         if (goodMaxProcessesPerUser(propertyValue,
                                     verboseTest) == false)
         { 
            errorExit ("MaxProcessesPerUser not correct");
         }
      }   // end if MaxProcessesPerUser 

      else if (propertyName.equal ("OperatingSystemCapability"))
      {
         String propertyValue;
         inst.getProperty(j).getValue().get(propertyValue);
         if (goodOSCapability(propertyValue,
                              verboseTest) == false)
         { 
            errorExit ("OSCapability not correct");
         }
      }   // end if OSCapability

      else if (propertyName.equal ("SystemUpTime"))
      {
         Uint64 propertyValue;
         inst.getProperty(j).getValue().get(propertyValue);
         if (goodSystemUpTime(propertyValue,
                              verboseTest) == false)
         { 
            errorExit ("SystemUpTime not correct");
         }
      }   // end if SystemUptime 

   }  // end of for looping through properties
}