def test_positive_update_realm(self): """Update a hostgroup with a new realm @feature: HostGroup @assert: A hostgroup is updated with expected realm """ realm = entities.Realm( location=[self.loc], organization=[self.org], realm_proxy=entities.SmartProxy().search()[0], ).create() hostgroup = entities.HostGroup( location=[self.loc], organization=[self.org], realm=realm, ).create() new_realm = entities.Realm( location=[self.loc], organization=[self.org], realm_proxy=entities.SmartProxy().search()[0], ).create() hostgroup.realm = new_realm hostgroup = hostgroup.update(['realm']) self.assertEqual(hostgroup.realm.read().name, new_realm.name)
def test_positive_update_realm(self, module_org, module_location): """Update a hostgroup with a new realm :id: fd9d141f-7a71-4439-92c7-1dbc1eea4772 :expectedresults: A hostgroup is updated with expected realm :CaseLevel: Integration """ realm = entities.Realm( location=[module_location], organization=[module_org], realm_proxy=entities.SmartProxy().search( query={ 'search': f'url = https://{settings.server.hostname}:9090' })[0], ).create() hostgroup = entities.HostGroup(location=[module_location], organization=[module_org], realm=realm).create() new_realm = entities.Realm( location=[module_location], organization=[module_org], realm_proxy=entities.SmartProxy().search( query={ 'search': f'url = https://{settings.server.hostname}:9090' })[0], ).create() hostgroup.realm = new_realm hostgroup = hostgroup.update(['realm']) assert hostgroup.realm.read().name == new_realm.name
def test_positive_update_realm(self): """Update a hostgroup with a new realm :id: fd9d141f-7a71-4439-92c7-1dbc1eea4772 :expectedresults: A hostgroup is updated with expected realm :CaseLevel: Integration """ realm = entities.Realm( location=[self.loc], organization=[self.org], realm_proxy=entities.SmartProxy().search( query={ 'search': 'url = https://{0}:9090'.format(settings.server.hostname) })[0]).create() hostgroup = entities.HostGroup( location=[self.loc], organization=[self.org], realm=realm, ).create() new_realm = entities.Realm( location=[self.loc], organization=[self.org], realm_proxy=entities.SmartProxy().search( query={ 'search': 'url = https://{0}:9090'.format(settings.server.hostname) })[0]).create() hostgroup.realm = new_realm hostgroup = hostgroup.update(['realm']) self.assertEqual(hostgroup.realm.read().name, new_realm.name)
def test_positive_update_realm(self): """Update a hostgroup with a new realm @id: fd9d141f-7a71-4439-92c7-1dbc1eea4772 @assert: A hostgroup is updated with expected realm @CaseLevel: Integration """ realm = entities.Realm( location=[self.loc], organization=[self.org], realm_proxy=entities.SmartProxy().search()[0], ).create() hostgroup = entities.HostGroup( location=[self.loc], organization=[self.org], realm=realm, ).create() new_realm = entities.Realm( location=[self.loc], organization=[self.org], realm_proxy=entities.SmartProxy().search()[0], ).create() hostgroup.realm = new_realm hostgroup = hostgroup.update(['realm']) self.assertEqual(hostgroup.realm.read().name, new_realm.name)
def test_positive_create_with_realm(self): """Create a hostgroup with realm specified @feature: HostGroup @assert: A hostgroup is created with expected realm assigned """ realm = entities.Realm( location=[self.loc], organization=[self.org], realm_proxy=entities.SmartProxy().search()[0], ).create() hostgroup = entities.HostGroup( location=[self.loc], organization=[self.org], realm=realm, ).create() self.assertEqual(hostgroup.realm.read().name, realm.name)
def test_positive_create_with_realm(self): """Create a hostgroup with realm specified :id: 4f07ff8d-746f-4ab5-ae0b-03d629f6296c :expectedresults: A hostgroup is created with expected realm assigned :CaseLevel: Integration """ realm = entities.Realm( location=[self.loc], organization=[self.org], realm_proxy=entities.SmartProxy().search( query={'search': f'url = https://{settings.server.hostname}:9090'} )[0], ).create() hostgroup = entities.HostGroup( location=[self.loc], organization=[self.org], realm=realm ).create() self.assertEqual(hostgroup.realm.read().name, realm.name)
def test_positive_create_with_realm(self, module_org, module_location, default_sat): """Create a hostgroup with realm specified :id: 4f07ff8d-746f-4ab5-ae0b-03d629f6296c :expectedresults: A hostgroup is created with expected realm assigned :CaseLevel: Integration """ realm = entities.Realm( location=[module_location], organization=[module_org], realm_proxy=entities.SmartProxy().search( query={'search': f'url = {default_sat.url}:9090'})[0], ).create() hostgroup = entities.HostGroup(location=[module_location], organization=[module_org], realm=realm).create() assert hostgroup.realm.read().name == realm.name
def test_positive_create_with_realm(self): """Create a hostgroup with realm specified @id: 4f07ff8d-746f-4ab5-ae0b-03d629f6296c @assert: A hostgroup is created with expected realm assigned @CaseLevel: Integration """ realm = entities.Realm( location=[self.loc], organization=[self.org], realm_proxy=entities.SmartProxy().search()[0], ).create() hostgroup = entities.HostGroup( location=[self.loc], organization=[self.org], realm=realm, ).create() self.assertEqual(hostgroup.realm.read().name, realm.name)
def realm_cleanup(realm_id=None): """Deletes the realm with the given id""" entities.Realm(id=realm_id).delete()