예제 #1
0
파일: device.py 프로젝트: szaydel/ralph
 def setUp(self):
     self.client = login_as_su()
     self.device = Device.create(
         sn=DEVICE['sn'],
         barcode=DEVICE['barcode'],
         remarks=DEVICE['remarks'],
         model_name=DEVICE['model_name'],
         model_type=DeviceType.unknown,
         rack=DEVICE['rack'],
         position=DEVICE['position'],
         dc=DATACENTER,
     )
     self.software1 = Software.create(
         dev=self.device,
         path='apache2',
         model_name='apache2 2.4.3',
         label='apache',
         family='http servers',
         version='2.4.3',
     )
     self.software1.save()
     self.software2 = Software.create(
         dev=self.device,
         path='gcc',
         model_name='gcc 4.7.2',
         label='gcc',
         family='compilers',
         version='4.7.2',
     )
     self.software2.save()
예제 #2
0
파일: device.py 프로젝트: szaydel/ralph
 def setUp(self):
     self.client = login_as_su()
     self.device = Device.create(
         sn=DEVICE['sn'],
         barcode=DEVICE['barcode'],
         remarks=DEVICE['remarks'],
         model_name=DEVICE['model_name'],
         model_type=DeviceType.unknown,
         rack=DEVICE['rack'],
         position=DEVICE['position'],
         dc=DATACENTER,
     )
     self.software1 = Software.create(
         dev=self.device,
         path='apache2',
         model_name='apache2 2.4.3',
         label='apache',
         family='http servers',
         version='2.4.3',
     )
     self.software1.save()
     self.software2 = Software.create(
         dev=self.device,
         path='gcc',
         model_name='gcc 4.7.2',
         label='gcc',
         family='compilers',
         version='4.7.2',
     )
     self.software2.save()
예제 #3
0
파일: reports.py 프로젝트: szaydel/ralph
 def setUp(self):
     self.client = login_as_su()
     self.service = CI(
         name='allegro.pl',
         type=CIType.objects.get(id=CI_TYPES.SERVICE)
     )
     self.service.save()
     self.db_service = CI.objects.get(id=self.service.id)
     self.venture = CI(
         name='allegro_prod',
         type=CIType.objects.get(id=CI_TYPES.VENTURE)
     )
     self.venture.save()
     self.ci_venture = CI.objects.get(id=self.venture.id)
     self.relation = CIRelation(
         parent=self.ci_venture,
         child=self.db_service,
         type=CI_RELATION_TYPES.CONTAINS,
     )
     self.relation.save()
예제 #4
0
파일: search.py 프로젝트: szaydel/ralph
 def setUp(self):
     self.client = login_as_su()
     venture = Venture(name=DEVICE["venture"], symbol=DEVICE["ventureSymbol"])
     venture.save()
     self.venture = venture
     venture_role = VentureRole(name=DEVICE["venture_role"], venture=self.venture)
     venture_role.save()
     self.venture_role = venture_role
     self.device = Device.create(
         sn=DEVICE["sn"],
         barcode=DEVICE["barcode"],
         remarks=DEVICE["remarks"],
         model_name=DEVICE["model_name"],
         model_type=DeviceType.unknown,
         venture=self.venture,
         venture_role=self.venture_role,
         rack=DEVICE["rack"],
         position=DEVICE["position"],
         dc=DATACENTER,
     )
     self.device.name = DEVICE["name"]
     self.device.save()
     self.ip = IPAddress(address=DEVICE["ip"], device=self.device)
     self.ip.save()
     self.db_ip = IPAddress.objects.get(address=DEVICE["ip"])
     self.network_terminator = NetworkTerminator(name="simple_terminator")
     self.network_terminator.save()
     self.network_datacenter = DataCenter(name=DATACENTER)
     self.network_datacenter.save()
     self.network = Network(name=NETWORK["name"], address=NETWORK["address"], data_center=self.network_datacenter)
     self.diskshare_device = Device.create(
         sn=DISKSHARE["sn"], barcode=DISKSHARE["barcode"], model_name="xxx", model_type=DeviceType.storage
     )
     self.diskshare_device.name = DISKSHARE["device"]
     self.diskshare_device.save()
     self.cm_generic = ComponentModel(name="GenericModel")
     self.cm_diskshare = ComponentModel(name="DiskShareModel")
     self.cm_processor = ComponentModel(name="ProcessorModel")
     self.cm_memory = ComponentModel(name="MemoryModel")
     self.cm_storage = ComponentModel(name="ComponentModel")
     self.cm_fibre = ComponentModel(name="FibreChannalMidel")
     self.cm_ethernet = ComponentModel(name="EthernetMidel")
     self.cm_software = ComponentModel(name="SoftwareModel")
     self.cm_splunkusage = ComponentModel(name="SplunkusageModel")
     self.cm_operatingsystem = ComponentModel(name="OperatingSystemModel")
     self.generic_component = GenericComponent(
         device=self.device, model=self.cm_generic, label=COMPONENT["GenericComponent"], sn=GENERIC["sn"]
     )
     self.generic_component.save()
     self.diskshare = DiskShare(
         device=self.device, model=self.cm_diskshare, share_id=self.device.id, size=80, wwn=DISKSHARE["wwn"]
     )
     self.diskshare.save()
     self.disksharemount = DiskShareMount.concurrent_get_or_create(
         share=self.diskshare, device=self.device, volume=COMPONENT["DiskShareMount"]
     )
     self.processor = Processor(device=self.device, model=self.cm_processor, label=COMPONENT["Processor"])
     self.processor.save()
     self.memory = Memory(device=self.device, model=self.cm_memory, label=COMPONENT["Memory"])
     self.memory.save()
     self.storage = Storage(device=self.device, model=self.cm_storage, label=COMPONENT["Storage"])
     self.storage.save()
     self.fibrechannel = FibreChannel(
         device=self.device, model=self.cm_fibre, label=COMPONENT["Fibre"], physical_id="01234"
     )
     self.fibrechannel.save()
     self.ethernet = Ethernet(model=self.cm_ethernet, device=self.device, mac=DEVICE["mac"])
     self.ethernet.save()
     self.software = Software(device=self.device, model=self.cm_software, label=COMPONENT["Software"])
     self.software.save()
     self.splunkusage = SplunkUsage(device=self.device, model=self.cm_splunkusage)
     self.splunkusage.save()
     self.operatingsystem = OperatingSystem(device=self.device, model=self.cm_operatingsystem, label=COMPONENT["OS"])
     self.operatingsystem.save()
예제 #5
0
파일: search.py 프로젝트: szaydel/ralph
 def setUp(self):
     self.client = login_as_su()
     venture = Venture(name=DEVICE['venture'],
                       symbol=DEVICE['ventureSymbol'])
     venture.save()
     self.venture = venture
     venture_role = VentureRole(name=DEVICE['venture_role'],
                                venture=self.venture)
     venture_role.save()
     self.venture_role = venture_role
     self.device = Device.create(
         sn=DEVICE['sn'],
         barcode=DEVICE['barcode'],
         remarks=DEVICE['remarks'],
         model_name=DEVICE['model_name'],
         model_type=DeviceType.unknown,
         venture=self.venture,
         venture_role=self.venture_role,
         rack=DEVICE['rack'],
         position=DEVICE['position'],
         dc=DATACENTER,
     )
     self.device.name = DEVICE['name']
     self.device.save()
     self.ip = IPAddress(address=DEVICE['ip'], device=self.device)
     self.ip.save()
     self.db_ip = IPAddress.objects.get(address=DEVICE['ip'])
     self.network_terminator = NetworkTerminator(name='simple_terminator')
     self.network_terminator.save()
     self.network_datacenter = DataCenter(name=DATACENTER)
     self.network_datacenter.save()
     self.network = Network(
         name=NETWORK['name'],
         address=NETWORK['address'],
         data_center=self.network_datacenter,
     )
     self.diskshare_device = Device.create(
         sn=DISKSHARE['sn'],
         barcode=DISKSHARE['barcode'],
         model_name='xxx',
         model_type=DeviceType.storage,
     )
     self.diskshare_device.name = DISKSHARE['device']
     self.diskshare_device.save()
     self.cm_generic = ComponentModel(name='GenericModel')
     self.cm_diskshare = ComponentModel(name='DiskShareModel')
     self.cm_processor = ComponentModel(name='ProcessorModel')
     self.cm_memory = ComponentModel(name='MemoryModel')
     self.cm_storage = ComponentModel(name='ComponentModel')
     self.cm_fibre = ComponentModel(name='FibreChannalMidel')
     self.cm_ethernet = ComponentModel(name='EthernetMidel')
     self.cm_software = ComponentModel(name='SoftwareModel')
     self.cm_splunkusage = ComponentModel(name='SplunkusageModel')
     self.cm_operatingsystem = ComponentModel(name='OperatingSystemModel')
     self.generic_component = GenericComponent(
         device=self.device,
         model=self.cm_generic,
         label=COMPONENT['GenericComponent'],
         sn=GENERIC['sn'],
     )
     self.generic_component.save()
     self.diskshare = DiskShare(
         device=self.device,
         model=self.cm_diskshare,
         share_id=self.device.id,
         size=80,
         wwn=DISKSHARE['wwn'],
     )
     self.diskshare.save()
     self.disksharemount = DiskShareMount.concurrent_get_or_create(
         share=self.diskshare,
         device=self.device,
         volume=COMPONENT['DiskShareMount'],
     )
     self.processor = Processor(
         device=self.device,
         model=self.cm_processor,
         label=COMPONENT['Processor'],
     )
     self.processor.save()
     self.memory = Memory(
         device=self.device,
         model=self.cm_memory,
         label=COMPONENT['Memory'],
     )
     self.memory.save()
     self.storage = Storage(
         device=self.device,
         model=self.cm_storage,
         label=COMPONENT['Storage'],
     )
     self.storage.save()
     self.fibrechannel = FibreChannel(
         device=self.device,
         model=self.cm_fibre,
         label=COMPONENT['Fibre'],
         physical_id='01234',
     )
     self.fibrechannel.save()
     self.ethernet = Ethernet(
         model=self.cm_ethernet,
         device=self.device,
         mac=DEVICE['mac'],
     )
     self.ethernet.save()
     self.software = Software(
         device=self.device,
         model=self.cm_software,
         label=COMPONENT['Software'],
     )
     self.software.save()
     self.splunkusage = SplunkUsage(
         device=self.device,
         model=self.cm_splunkusage,
     )
     self.splunkusage.save()
     self.operatingsystem = OperatingSystem(
         device=self.device,
         model=self.cm_operatingsystem,
         label=COMPONENT['OS'],
     )
     self.operatingsystem.save()