def testNoValues(self):
        template=createTemplate(self.dmd, 'TestTemplate1')
        dev=createTestDevice( self.dmd, 'TestDevice1', dict(
                                zDeviceTemplates=[template.id] ) )

        records=filesystems().run( self.dmd, {'deviceClass':'/Devices/Server', 'generate':True} )
        self.assertEquals( 0, len( records ) )
Esempio n. 2
0
    def testNoValues(self):
        template=createTemplate(self.dmd, 'TestTemplate1')
        dev=createTestDevice( self.dmd, 'TestDevice1', dict(
                                zDeviceTemplates=[template.id] ) )

        records=filesystems().run( self.dmd, {'deviceClass':'/Devices/Server', 'generate':True} )
        self.assertEquals( 0, len( records ) )
 def testOneValue(self):
     testBlockSize=10
     testTotalBlocks=20
     testUsedBlocks=5
     createFileSystemTemplate( self.dmd )      
     dev2=createTestDeviceWithFileSystemTemplateBound( self.dmd, 
                                                       'TestDevice2' )
     filesystem1=createFilesystem( dev2, 'TestFilesystem2', testBlockSize,
                                   testTotalBlocks, testUsedBlocks )
 
     plugin = filesystems()
     records = plugin.run( self.dmd, {'deviceClass':'/Devices/Server', 'generate':True} )
     
     self.assertEquals( 1, len( records ) )
     assertFileSystemRowIsCorrect( self, records, dev2, filesystem1, 
                                   testBlockSize, testTotalBlocks,
                                   testUsedBlocks )
Esempio n. 4
0
 def testOneValue(self):
     testBlockSize=10
     testTotalBlocks=20
     testUsedBlocks=5
     createFileSystemTemplate( self.dmd )      
     dev2=createTestDeviceWithFileSystemTemplateBound( self.dmd, 
                                                       'TestDevice2' )
     filesystem1=createFilesystem( dev2, 'TestFilesystem2', testBlockSize,
                                   testTotalBlocks, testUsedBlocks )
 
     plugin = filesystems()
     records = plugin.run( self.dmd, {'deviceClass':'/Devices/Server', 'generate':True} )
     
     self.assertEquals( 1, len( records ) )
     assertFileSystemRowIsCorrect( self, records, dev2, filesystem1, 
                                   testBlockSize, testTotalBlocks,
                                   testUsedBlocks )
 def testMultipleValues(self):
     #import pydevd;pydevd.settrace()
     testProperties = [
                       ( 'testdevice3', [ ('testfs3_1', 10, 20, 15 ),
                                          ('testfs3_2', 8, 100, 98 )] ),
                       ( 'testdevice4', [ ( 'testfs4_1', 10, 20, 15 ) ] ),
                       ( 'testdevice5', [ ( 'testfs5_1', 10, 20, 15 ),
                                          ( 'testfs5_2', 10, 20, 15 ),
                                          ( 'testfs5_3', 10, 20, 15 ) ] ),
                       ( 'testdevice6', [] )
                     ]         
     createFileSystemTemplate( self.dmd )
     filesystemCount = 0
     testObjects = {}
     for propertySet in testProperties:
         device = createTestDeviceWithFileSystemTemplateBound( self.dmd,
                                                               propertySet[0] )
         testFilesystems = []
         for filesystemProperties in propertySet[1]:
             filesystem = createFilesystem( device,
                                            filesystemProperties[0],
                                            filesystemProperties[1],
                                            filesystemProperties[2],
                                            filesystemProperties[3]                                               
                                            )
             testFilesystems.append( filesystem )
             filesystemCount += 1
         testObjects[device]=testFilesystems
     
     plugin = filesystems()
     records = plugin.run( self.dmd, {'deviceClass':'/Devices/Server', 'generate':True} )
     
     self.assertEquals( filesystemCount, len( records ) )
     for device, filesystemObjects in testObjects.iteritems():
         for filesystem in filesystemObjects:
             assertFileSystemRowIsCorrect( self, records, device, filesystem,
                 filesystem.blockSize,
                 filesystem.totalBlocks,
                 filesystem.usedBlocks_usedBlocks / filesystem.blockSize )
Esempio n. 6
0
 def testMultipleValues(self):
     #import pydevd;pydevd.settrace()
     testProperties = [
                       ( 'testdevice3', [ ('testfs3_1', 10, 20, 15 ),
                                          ('testfs3_2', 8, 100, 98 )] ),
                       ( 'testdevice4', [ ( 'testfs4_1', 10, 20, 15 ) ] ),
                       ( 'testdevice5', [ ( 'testfs5_1', 10, 20, 15 ),
                                          ( 'testfs5_2', 10, 20, 15 ),
                                          ( 'testfs5_3', 10, 20, 15 ) ] ),
                       ( 'testdevice6', [] )
                     ]         
     createFileSystemTemplate( self.dmd )
     filesystemCount = 0
     testObjects = {}
     for propertySet in testProperties:
         device = createTestDeviceWithFileSystemTemplateBound( self.dmd,
                                                               propertySet[0] )
         testFilesystems = []
         for filesystemProperties in propertySet[1]:
             filesystem = createFilesystem( device,
                                            filesystemProperties[0],
                                            filesystemProperties[1],
                                            filesystemProperties[2],
                                            filesystemProperties[3]                                               
                                            )
             testFilesystems.append( filesystem )
             filesystemCount += 1
         testObjects[device]=testFilesystems
     
     plugin = filesystems()
     records = plugin.run( self.dmd, {'deviceClass':'/Devices/Server', 'generate':True} )
     
     self.assertEquals( filesystemCount, len( records ) )
     for device, filesystemObjects in testObjects.iteritems():
         for filesystem in filesystemObjects:
             assertFileSystemRowIsCorrect( self, records, device, filesystem,
                 filesystem.blockSize,
                 filesystem.totalBlocks,
                 filesystem.usedBlocks_usedBlocks / filesystem.blockSize )