def test_02_delete_single_orphan(self):
     old_info = Orphans.info(self.pulp)
     rpm_orphans = RpmOrphan.list(self.pulp)
     assert rpm_orphans, "No orphans found; there might be other 'Zoo' repos in %s" % self.pulp
     rpm_orphans[0].delete(self.pulp)
     del rpm_orphans[0]
     self.assertPulpOK()
     new_info = Orphans.info(self.pulp)
     self.assertEqual(old_info['rpm']['count'], new_info['rpm']['count'] + 1)
     self.assertEqual(
         sorted(map(lambda x: x.data['name'], rpm_orphans)),
         sorted(map(lambda x: x.data['name'], RpmOrphan.list(self.pulp)))
     )
 def test_02_delete_single_orphan(self):
     old_info = Orphans.info(self.pulp)
     rpm_orphans = RpmOrphan.list(self.pulp)
     assert rpm_orphans, "No orphans found; there might be other 'Zoo' repos in %s" % self.pulp
     response = rpm_orphans[0].delete(self.pulp)
     Task.wait_for_report(self.pulp, response)
     del rpm_orphans[0]
     self.assertPulpOK()
     new_info = Orphans.info(self.pulp)
     self.assertEqual(old_info['rpm']['count'], new_info['rpm']['count'] + 1)
     self.assertEqual(
         sorted(map(lambda x: x.data['name'], rpm_orphans)),
         sorted(map(lambda x: x.data['name'], RpmOrphan.list(self.pulp)))
     )
 def test_03_delete_orphans(self):
     delete_response = Orphans.delete(self.pulp)
     self.assertPulpOK()
     Task.wait_for_report(self.pulp, delete_response)
     info = Orphans.info(self.pulp)
     orphans = Orphans.get(self.pulp)
     self.assertPulpOK()
     for orphan_type_name in info.keys():
         self.assertEqual(len(orphans[orphan_type_name]), info[orphan_type_name]['count'])
         self.assertEqual(orphans[orphan_type_name], [])
 def test_10_check_orphan_appears(self):
     # unasosciate same module that was unassocited in dest_repo1
     response = self.dest_repo2.unassociate_units(
         self.pulp, data={"criteria": {"type_ids": ["puppet_module"], "filters": {"unit": {"name": "tomcat7_rhel"}}}}
     )
     self.assertPulp(code=202)
     Task.wait_for_report(self.pulp, response)
     # check 1 orphan appeared
     orphan_info = Orphans.info(self.pulp)
     self.assertEqual(orphan_info["puppet_module"]["count"], 1)
Beispiel #5
0
 def test_10_check_orphan_appears(self):
     #unasosciate same module that was unassocited in dest_repo1
     response = self.dest_repo2.unassociate_units(
         self.pulp,
         data={"criteria": {"type_ids": ["puppet_module"], "filters": {"unit": {"name": "tomcat7_rhel"}}}}
     )
     self.assertPulp(code=202)
     Task.wait_for_report(self.pulp, response)
     #check 1 orphan appeared
     orphan_info = Orphans.info(self.pulp)
     self.assertEqual(orphan_info['puppet_module']['count'], 1)
 def test_01_orphan_info_data_integrity(self):
     info = Orphans.info(self.pulp)
     orphans = Orphans.get(self.pulp)
     self.assertPulpOK()
     for orphan_type_name in orphans.keys():
         # reported count info is the same as the orphans counted
         self.assertEqual(len(orphans[orphan_type_name]), info[orphan_type_name]['count'])
         orphan_type = UnitFactory.type_map.orphans[orphan_type_name]
         # '_href' is correct
         self.assertEqual(pulp_auto.path_join(pulp_auto.path, orphan_type.path), info[orphan_type_name]['_href'])
         # all orphans are of the same type
         for orphan in orphans[orphan_type_name]:
             self.assertTrue(isinstance(orphan, orphan_type), "different type: %s, %s" % (orphan_type_name, orphan.type_id))
 def test_09_check_orphan_appears(self):
     #delete source repo
     self.source_repo.delete(self.pulp)
     self.assertPulpOK()
     #unasosciate same module that was unassocited in dest_repo1
     response = self.dest_repo2.unassociate_units(
         self.pulp,
         data={"criteria": {"type_ids": ["iso"], "filters": {"unit": {"name": "test.iso"}}}}
     )
     self.assertPulp(code=202)
     Task.wait_for_report(self.pulp, response)
     #check 1 orphan appeared
     orphan_info = Orphans.info(self.pulp)
     self.assertEqual(orphan_info['iso']['count'], 1)
 def test_09_check_orphan_appears(self):
     #delete source repo
     self.source_repo.delete(self.pulp)
     self.assertPulpOK()
     #unasosciate same module that was unassocited in dest_repo1
     response = self.dest_repo2.unassociate_units(
         self.pulp,
         data={"criteria": {"type_ids": ["puppet_module"], "filters": {"unit": {"name": "tomcat7_rhel"}}}}
     )
     self.assertPulp(code=202)
     task = Task.from_response(response)
     task.wait(self.pulp)
     #check 1 orphan appeared
     orphan_info = Orphans.info(self.pulp)
     self.assertEqual(orphan_info['puppet_module']['count'], 1)
Beispiel #9
0
 def test_09_check_orphan_appears(self):
     #delete source repo
     response = self.source_repo.delete(self.pulp)
     self.assertPulpOK()
     Task.wait_for_report(self.pulp, response)
     #unasosciate same module that was unassocited in dest_repo1
     response = self.dest_repo2.unassociate_units(self.pulp,
                                                  data={
                                                      "criteria": {
                                                          "type_ids":
                                                          ["iso"],
                                                          "filters": {
                                                              "unit": {
                                                                  "name":
                                                                  "test.iso"
                                                              }
                                                          }
                                                      }
                                                  })
     self.assertPulp(code=202)
     Task.wait_for_report(self.pulp, response)
     #check 1 orphan appeared
     orphan_info = Orphans.info(self.pulp)
     self.assertEqual(orphan_info['iso']['count'], 1)
 def test_08_check_no_orphan_appeared(self):
     #check that after unassociation of module it did not appered among orphans as it is still referenced to other repo
     orphans = Orphans.get(self.pulp)
     self.assertEqual(orphans['iso'], [])
     orphan_info = Orphans.info(self.pulp)
     self.assertEqual(orphan_info['iso']['count'], 0)
 def test_13_check_deleted_orphans(self):
     # check that all puppet_module orphans were successfully deleted
     orphans = Orphans.get(self.pulp)
     self.assertEqual(orphans['iso'], [])
     orphan_info = Orphans.info(self.pulp)
     self.assertEqual(orphan_info['iso']['count'], 0)
Beispiel #12
0
 def test_13_check_deleted_orphans(self):
     # check that all puppet_module orphans were successfully deleted
     orphans = Orphans.get(self.pulp)
     self.assertEqual(orphans['iso'], [])
     orphan_info = Orphans.info(self.pulp)
     self.assertEqual(orphan_info['iso']['count'], 0)
Beispiel #13
0
 def test_08_check_no_orphan_appeared(self):
     #check that after unassociation of module it did not appered among orphans as it is still referenced to other repo
     orphans = Orphans.get(self.pulp)
     self.assertEqual(orphans['iso'], [])
     orphan_info = Orphans.info(self.pulp)
     self.assertEqual(orphan_info['iso']['count'], 0)
 def test_01_view_orphaned_content_by_type(self):
     rpm_orphans = RpmOrphan.list(self.pulp)
     self.assertPulpOK()
     all_orphans = Orphans.info(self.pulp)
     self.assertEqual(len(rpm_orphans), all_orphans['rpm']['count'])
 def test_00_view_all_orphaned_content(self):
     Orphans.info(self.pulp)
     self.assertPulpOK()
 def test_00_get_orphan_info(self):
     Orphans.info(self.pulp)
     self.assertPulpOK()