def test_positive_realm_update_name( subscribe_satellite, enroll_idm_and_configure_external_auth, configure_realm, module_fake_proxy, request, ): """Test updating realm name :id: c09e6599-c77a-4290-ac93-311d06e3d860 :expectedresults: Realm name can be updated """ realm_name = gen_string('alpha', random.randint(1, 30)) new_realm_name = gen_string('alpha', random.randint(1, 30)) realm = make_realm({ 'name': realm_name, 'realm-proxy-id': module_fake_proxy.id, 'realm-type': 'Red Hat Identity Management', 'locations': [loc.read().name for loc in module_fake_proxy.location], }) request.addfinalizer(lambda: realm_cleanup(realm['id'])) assert realm['name'] == realm_name up = Realm.update({'id': realm['id'], 'new-name': new_realm_name}) assert up[0]['message'] == f'Realm [{new_realm_name}] updated.' info = Realm.info({'id': realm['id']}) assert info['name'] == new_realm_name
def test_negative_realm_update_invalid_type( subscribe_satellite, enroll_idm_and_configure_external_auth, configure_realm, module_fake_proxy, request, ): """Test updating realm with an invalid type :id: 3097f8e5-9152-4d8d-9991-969bdfc9c4d4 :expectedresults: Realm is not updated """ realm_type = 'Red Hat Identity Management' new_realm_type = gen_string('alpha') realm = make_realm({ 'name': gen_string('alpha', random.randint(1, 30)), 'realm-proxy-id': module_fake_proxy.id, 'realm-type': realm_type, 'locations': [loc.read().name for loc in module_fake_proxy.location], }) request.addfinalizer(lambda: realm_cleanup(realm['id'])) with pytest.raises(CLIReturnCodeError): Realm.update({'id': realm['id'], 'realm-type': new_realm_type})
def test_positive_realm_info_id( subscribe_satellite, enroll_idm_and_configure_external_auth, configure_realm, module_fake_proxy, request, ): """Test realm info functionality :id: 1ae7b3af-221e-4480-9e93-d05d573456b4 :expectedresults: Realm information obtained by ID is correct """ realm = make_realm({ 'name': gen_string('alpha', random.randint(1, 30)), 'realm-proxy-id': module_fake_proxy.id, 'realm-type': 'Red Hat Identity Management', 'locations': [loc.read().name for loc in module_fake_proxy.location], }) request.addfinalizer(lambda: realm_cleanup(realm['id'])) info = Realm.info({'id': realm['id']}) for key in info.keys(): assert info[key] == realm[key] assert info == Realm.info({'id': realm['id']})
def test_negative_info_nonexistent_realm_name(self): """Get info for a realm with a name that does not exist :id: 24e4fbfa-7141-4f90-8c5d-eb88b162bd64 :expectedresults: Realm not found """ with pytest.raises(CLIReturnCodeError): Realm.info({'name': gen_string('alpha', random.randint(1, 30))})
def test_negative_delete_nonexistent_realm_name(self): """Delete a realm with a name that does not exist :id: 616db509-9643-4817-ba6b-f05cdb1cecb0 :expectedresults: Realm not found """ with self.assertRaises(CLIReturnCodeError): Realm.delete({'name': self.realm_name})
def test_negative_delete_nonexistent_realm_name(self): """Delete a realm with a name that does not exist :id: 616db509-9643-4817-ba6b-f05cdb1cecb0 :expectedresults: Realm not found """ with pytest.raises(CLIReturnCodeError): Realm.delete({'name': gen_string('alpha', random.randint(1, 30))})
def test_negative_info_nonexistent_realm_id(self): """Get info for a realm with an ID that does not exists :id: db8382eb-6d0b-4d6a-a9bf-38a462389f7b :expectedresults: Realm not found """ with pytest.raises(CLIReturnCodeError): Realm.info({'id': 0})
def test_negative_delete_nonexistent_realm_id(self): """Delete a realm with an ID that does not exist :id: 70bb9d4e-7e71-479a-8c82-e6fcff88ea14 :expectedresults: Realm not found """ with pytest.raises(CLIReturnCodeError): Realm.delete({'id': 0})
def test_negative_info_nonexistent_realm_name(self): """Get info for a realm with a name that does not exist :id: 24e4fbfa-7141-4f90-8c5d-eb88b162bd64 :expectedresults: Realm not found """ with self.assertRaises(CLIReturnCodeError): Realm.info({'name': self.realm_name})
def test_negative_delete_nonexistent_realm_id(self): """Delete a realm with an id that does not exist :id: 70bb9d4e-7e71-479a-8c82-e6fcff88ea14 :expectedresults: Realm not found """ with self.assertRaises(CLIReturnCodeError): Realm.delete({'id': 0})
def test_negative_delete_nonexistent_realm_name(self): """Delete a realm with a name that does not exist :id: 616db509-9643-4817-ba6b-f05cdb1cecb0 :expectedresults: Realm not found """ with self.assertRaises(CLIReturnCodeError): Realm.delete({'name': self.realm_name})
def test_negative_info_nonexistent_realm_name(self): """Get info for a realm with a name that does not exist :id: 24e4fbfa-7141-4f90-8c5d-eb88b162bd64 :expectedresults: Realm not found """ with self.assertRaises(CLIReturnCodeError): Realm.info({'name': self.realm_name})
def test_negative_info_nonexistent_realm_id(self): """Get info for a realm with an id that does not exists :id: db8382eb-6d0b-4d6a-a9bf-38a462389f7b :expectedresults: Realm not found """ with self.assertRaises(CLIReturnCodeError): Realm.info({'id': 0})
def test_positive_delete_by_name(self, _make_proxy): """Realm deletion by realm name :id: ef3967e6-d53d-4dec-b74f-c20448d5fc6d :expectedresults: Realm is deleted """ realm = make_realm({ 'realm-proxy-id': _make_proxy['id'], 'realm-type': 'Active Directory' }) Realm.delete({'name': realm['name']}) with pytest.raises(CLIReturnCodeError): Realm.info({'id': realm['id']})
def test_positive_delete_by_name(self): """Realm deletion by realm name :id: ef3967e6-d53d-4dec-b74f-c20448d5fc6d :expectedresults: Realm is deleted """ proxy = self._make_proxy() realm = make_realm({ 'realm-proxy-id': proxy['id'], 'realm-type': 'Active Directory' }) Realm.delete({'name': realm['name']}) with self.assertRaises(CLIReturnCodeError): Realm.info({'id': realm['id']})
def test_positive_delete_by_id(self): """Realm deletion by realm id :id: 7c1aca0e-9724-40de-b38f-9189bdae0514 :expectedresults: Realm is deleted """ proxy = self._make_proxy() realm = make_realm({ 'realm-proxy-id': proxy['id'], 'realm-type': 'Active Directory' }) Realm.delete({'id': realm['id']}) with self.assertRaises(CLIReturnCodeError): Realm.info({'id': realm['id']})
def test_positive_delete_by_id(self, _make_proxy): """Realm deletion by realm ID :id: 7c1aca0e-9724-40de-b38f-9189bdae0514 :expectedresults: Realm is deleted """ proxy = _make_proxy realm = make_realm({ 'realm-proxy-id': proxy['id'], 'realm-type': 'Active Directory' }) Realm.delete({'id': realm['id']}) with pytest.raises(CLIReturnCodeError): Realm.info({'id': realm['id']})
def test_positive_delete_by_name(subscribe_satellite, enroll_idm_and_configure_external_auth, configure_realm, module_fake_proxy): """Realm deletion by realm name :id: ef3967e6-d53d-4dec-b74f-c20448d5fc6d :expectedresults: Realm is deleted """ realm = make_realm({ 'realm-proxy-id': module_fake_proxy.id, 'realm-type': 'Active Directory' }) Realm.delete({'name': realm['name']}) with pytest.raises(CLIReturnCodeError): Realm.info({'id': realm['id']})
def test_positive_delete_by_id(subscribe_satellite, enroll_idm_and_configure_external_auth, configure_realm, module_fake_proxy): """Realm deletion by realm ID :id: 7c1aca0e-9724-40de-b38f-9189bdae0514 :expectedresults: Realm is deleted """ realm = make_realm({ 'realm-proxy-id': module_fake_proxy.id, 'realm-type': 'Active Directory' }) Realm.delete({'id': realm['id']}) with pytest.raises(CLIReturnCodeError): Realm.info({'id': realm['id']})
def test_positive_realm_info_id(self): """Test realm info functionality :id: 1ae7b3af-221e-4480-9e93-d05d573456b4 :expectedresults: Realm information obtained by ID is correct """ proxy = self._make_proxy() self.realm = make_realm({ 'name': self.realm_name, 'realm-proxy-id': proxy['id'], 'realm-type': 'Red Hat Identity Management', 'locations': proxy['locations'], }) info = Realm.info({'id': self.realm['id']}) for key in info.keys(): self.assertEquals(info[key], self.realm[key]) self.assertEquals(info, Realm.info({'id': self.realm['id']}))
def test_positive_realm_info_id(self): """Test realm info functionality :id: 1ae7b3af-221e-4480-9e93-d05d573456b4 :expectedresults: Realm info information from ID is correct """ proxy = self._make_proxy() self.realm = make_realm({ 'name': self.realm_name, 'realm-proxy-id': proxy['id'], 'realm-type': 'Red Hat Identity Management', 'locations': proxy['locations'] }) info = Realm.info({'id': self.realm['id']}) for key in info.keys(): self.assertEquals(info[key], self.realm[key]) self.assertEquals(info, Realm.info({'id': self.realm['id']}))
def test_negative_realm_update_invalid_type(self, _make_proxy): """Test updating realm with an invalid type :id: 3097f8e5-9152-4d8d-9991-969bdfc9c4d4 :expectedresults: Realm is not updated """ realm_type = 'Red Hat Identity Management' new_realm_type = gen_string('alpha') proxy = _make_proxy realm = make_realm({ 'name': gen_string('alpha', random.randint(1, 30)), 'realm-proxy-id': proxy['id'], 'realm-type': realm_type, 'locations': proxy['locations'], }) with pytest.raises(CLIReturnCodeError): Realm.update({'id': realm['id'], 'realm-type': new_realm_type})
def test_positive_realm_info_id(self, _make_proxy): """Test realm info functionality :id: 1ae7b3af-221e-4480-9e93-d05d573456b4 :expectedresults: Realm information obtained by ID is correct """ proxy = _make_proxy realm = make_realm({ 'name': gen_string('alpha', random.randint(1, 30)), 'realm-proxy-id': proxy['id'], 'realm-type': 'Red Hat Identity Management', 'locations': proxy['locations'], }) info = Realm.info({'id': realm['id']}) for key in info.keys(): assert info[key] == realm[key] assert info == Realm.info({'id': realm['id']})
def test_negative_realm_update_invalid_type(self): """Test updating realm with an invalid type :id: 3097f8e5-9152-4d8d-9991-969bdfc9c4d4 :expectedresults: Realm is not updated """ realm_type = 'Red Hat Identity Management' new_realm_type = gen_string('alpha') proxy = self._make_proxy() self.realm = make_realm({ 'name': self.realm_name, 'realm-proxy-id': proxy['id'], 'realm-type': realm_type, 'locations': proxy['locations'] }) with self.assertRaises(CLIReturnCodeError): Realm.update({ 'id': self.realm['id'], 'realm-type': new_realm_type })
def test_positive_realm_update_name(self, _make_proxy): """Test updating realm name :id: c09e6599-c77a-4290-ac93-311d06e3d860 :expectedresults: Realm name can be updated """ realm_name = gen_string('alpha', random.randint(1, 30)) new_realm_name = gen_string('alpha', random.randint(1, 30)) proxy = _make_proxy realm = make_realm({ 'name': realm_name, 'realm-proxy-id': proxy['id'], 'realm-type': 'Red Hat Identity Management', 'locations': proxy['locations'], }) assert realm['name'] == realm_name up = Realm.update({'id': realm['id'], 'new-name': new_realm_name}) assert up[0]['message'] == f'Realm [{new_realm_name}] updated.' info = Realm.info({'id': realm['id']}) assert info['name'] == new_realm_name
def test_negative_realm_update_invalid_type(self): """Test updating realm with an invalid type :id: 3097f8e5-9152-4d8d-9991-969bdfc9c4d4 :expectedresults: Realm is not updated """ realm_type = 'Red Hat Identity Management' new_realm_type = gen_string('alpha') proxy = self._make_proxy() self.realm = make_realm({ 'name': self.realm_name, 'realm-proxy-id': proxy['id'], 'realm-type': realm_type, 'locations': proxy['locations'] }) with self.assertRaises(CLIReturnCodeError): Realm.update({ 'id': self.realm['id'], 'realm-type': new_realm_type })
def test_positive_realm_update_name(self): """Test updating realm name :id: c09e6599-c77a-4290-ac93-311d06e3d860 :expectedresults: Realm name can be updated """ realm_name = gen_string('alphanumeric') new_realm_name = self.realm_name proxy = self._make_proxy() self.realm = make_realm({ 'name': realm_name, 'realm-proxy-id': proxy['id'], 'realm-type': 'Red Hat Identity Management', 'locations': proxy['locations'], }) self.assertEquals(self.realm['name'], realm_name) up = Realm.update({'id': self.realm['id'], 'new-name': new_realm_name}) self.assertEquals(up[0]['message'], 'Realm [{0}] updated.'.format(new_realm_name)) info = Realm.info({'id': self.realm['id']}) self.assertEquals(info['name'], new_realm_name)
def test_positive_realm_update_name(self): """Test updating realm name :id: c09e6599-c77a-4290-ac93-311d06e3d860 :expectedresults: Realm name updated """ realm_name = gen_string('alphanumeric') new_realm_name = self.realm_name proxy = self._make_proxy() self.realm = make_realm({ 'name': realm_name, 'realm-proxy-id': proxy['id'], 'realm-type': 'Red Hat Identity Management', 'locations': proxy['locations'] }) self.assertEquals(self.realm['name'], realm_name) up = Realm.update({'id': self.realm['id'], 'new-name': new_realm_name}) self.assertEquals( up[0]['message'], 'Realm [{0}] updated.'.format(new_realm_name) ) info = Realm.info({'id': self.realm['id']}) self.assertEquals(info['name'], new_realm_name)
def test_positive_realm_info_name(self): """Test realm info functionality :id: 2e3e92df-61f3-4c6b-98b9-dc9c2f8d140c :expectedresults: Realm info information from name is correct """ proxy = self._make_proxy() self.realm = make_realm({ 'name': self.realm_name, 'realm-proxy-id': proxy['id'], 'realm-type': 'Red Hat Identity Management', 'locations': proxy['locations'] }) info = Realm.info({'name': self.realm['name']}) for key in info.keys(): self.assertEquals(info[key], self.realm[key])
def test_positive_realm_info_name(self): """Test realm info functionality :id: 2e3e92df-61f3-4c6b-98b9-dc9c2f8d140c :expectedresults: Realm information obtained by name is correct """ proxy = self._make_proxy() self.realm = make_realm({ 'name': self.realm_name, 'realm-proxy-id': proxy['id'], 'realm-type': 'Red Hat Identity Management', 'locations': proxy['locations'], }) info = Realm.info({'name': self.realm['name']}) for key in info.keys(): self.assertEquals(info[key], self.realm[key])
def test_positive_realm_info_name(self, _make_proxy): """Test realm info functionality :id: 2e3e92df-61f3-4c6b-98b9-dc9c2f8d140c :expectedresults: Realm information obtained by name is correct """ proxy = _make_proxy realm = make_realm({ 'name': gen_string('alpha', random.randint(1, 30)), 'realm-proxy-id': proxy['id'], 'realm-type': 'Red Hat Identity Management', 'locations': proxy['locations'], }) info = Realm.info({'name': realm['name']}) for key in info.keys(): assert info[key] == realm[key]