コード例 #1
0
 def test_unknown(self):
     '''
     Test method get_cloud_type() for unknown systems.
     Forcing read_dmi_data return to match an unrecognized return.
     '''
     util.read_dmi_data = _dmi_data('Unrecognized Platform')
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEqual('UNKNOWN', dsrc.get_cloud_type())
コード例 #2
0
 def test_rhev(self):
     '''
     Test method get_cloud_type() for RHEVm systems.
     Forcing read_dmi_data return to match a RHEVm system: RHEV Hypervisor
     '''
     util.read_dmi_data = _dmi_data('RHEV')
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEqual('RHEV', dsrc.get_cloud_type())
コード例 #3
0
 def test_vsphere(self):
     '''
     Test method get_cloud_type() for vSphere systems.
     Forcing read_dmi_data return to match a vSphere system: RHEV Hypervisor
     '''
     util.read_dmi_data = _dmi_data('VMware Virtual Platform')
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEqual('VSPHERE', dsrc.get_cloud_type())
コード例 #4
0
 def test_unknown(self):
     '''
     Test method get_cloud_type() for unknown systems.
     Forcing read_dmi_data return to match an unrecognized return.
     '''
     util.read_dmi_data = _dmi_data('Unrecognized Platform')
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('UNKNOWN', dsrc.get_cloud_type())
コード例 #5
0
 def test_vsphere(self):
     '''
     Test method get_cloud_type() for vSphere systems.
     Forcing read_dmi_data return to match a vSphere system: RHEV Hypervisor
     '''
     util.read_dmi_data = _dmi_data('VMware Virtual Platform')
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('VSPHERE', dsrc.get_cloud_type())
コード例 #6
0
 def test_rhev(self):
     '''
     Test method get_cloud_type() for RHEVm systems.
     Forcing read_dmi_data return to match a RHEVm system: RHEV Hypervisor
     '''
     util.read_dmi_data = _dmi_data('RHEV')
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('RHEV', dsrc.get_cloud_type())
コード例 #7
0
 def test_exception2(self):
     '''
     Test method get_cloud_type() where command dmidecode is not available.
     '''
     cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
         ['bad command']
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('UNKNOWN', \
         dsrc.get_cloud_type())
コード例 #8
0
 def test_exception2(self):
     '''
     Test method get_cloud_type() where command dmidecode is not available.
     '''
     cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
         ['bad command']
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('UNKNOWN', \
         dsrc.get_cloud_type())
コード例 #9
0
 def test_unknown(self):
     '''
     Test method get_cloud_type() for unknown systems.
     Forcing dmidecode return to match an unrecognized return.
     '''
     cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
         ['echo', 'Unrecognized Platform']
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('UNKNOWN', \
         dsrc.get_cloud_type())
コード例 #10
0
 def test_vsphere(self):
     '''
     Test method get_cloud_type() for vSphere systems.
     Forcing dmidecode return to match a vSphere system: RHEV Hypervisor
     '''
     cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
         ['echo', 'VMware Virtual Platform']
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('VSPHERE', \
         dsrc.get_cloud_type())
コード例 #11
0
 def test_rhev(self):
     '''
     Test method get_cloud_type() for RHEVm systems.
     Forcing dmidecode return to match a RHEVm system: RHEV Hypervisor
     '''
     cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
         ['echo', 'RHEV Hypervisor']
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('RHEV', \
         dsrc.get_cloud_type())
コード例 #12
0
 def test_unknown(self):
     '''
     Test method get_cloud_type() for unknown systems.
     Forcing dmidecode return to match an unrecognized return.
     '''
     cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
         ['echo', 'Unrecognized Platform']
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('UNKNOWN', \
         dsrc.get_cloud_type())
コード例 #13
0
 def test_vsphere(self):
     '''
     Test method get_cloud_type() for vSphere systems.
     Forcing dmidecode return to match a vSphere system: RHEV Hypervisor
     '''
     cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
         ['echo', 'VMware Virtual Platform']
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('VSPHERE', \
         dsrc.get_cloud_type())
コード例 #14
0
 def test_rhev(self):
     '''
     Test method get_cloud_type() for RHEVm systems.
     Forcing dmidecode return to match a RHEVm system: RHEV Hypervisor
     '''
     cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
         ['echo', 'RHEV Hypervisor']
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('RHEV', \
         dsrc.get_cloud_type())