Beispiel #1
0
def test_positive_add_and_remove_media(module_org):
    """Add and remove medium to organization

    :id: c2943a81-c8f7-44c4-926b-388055d7c290

    :expectedresults: Media are handled as expected

    :BZ: 1395229

    :steps:
        1. add and remove medium by id
        2. add and remove medium by name

    :CaseLevel: Integration
    """
    media = [make_medium() for _ in range(0, 2)]
    Org.add_medium({'id': module_org.id, 'medium-id': media[0]['id']})
    Org.add_medium({'name': module_org.name, 'medium': media[1]['name']})
    org_info = Org.info({'id': module_org.id})
    assert media[0]['name'] in org_info['installation-media'], "Failed to add medium by id"
    assert media[1]['name'] in org_info['installation-media'], "Failed to add medium by name"
    Org.remove_medium({'name': module_org.name, 'medium': media[0]['name']})
    Org.remove_medium({'id': module_org.id, 'medium-id': media[1]['id']})
    org_info = Org.info({'id': module_org.id})
    assert media[0]['name'] not in org_info['installation-media'], "Failed to remove medium by name"
    assert media[1]['name'] not in org_info['installation-media'], "Failed to remove medium by id"
Beispiel #2
0
    def test_positive_add_and_remove_media(self):
        """Add and remove medium to organization

        :id: c2943a81-c8f7-44c4-926b-388055d7c290

        :expectedresults: Media are handled as expected

        :BZ: 1395229

        :steps:
            1. add and remove medium by id
            2. add and remove medium by name

        :CaseLevel: Integration
        """
        medium_a = make_medium()
        medium_b = make_medium()
        Org.add_medium({'id': self.org['id'], 'medium-id': medium_a['id']})
        Org.add_medium({'name': self.org['name'], 'medium': medium_b['name']})
        org_info = Org.info({'id': self.org['id']})
        self.assertIn(medium_a['name'], org_info['installation-media'],
                      "Failed to add medium by id")
        self.assertIn(medium_b['name'], org_info['installation-media'],
                      "Failed to add medium by name")
        Org.remove_medium({
            'name': self.org['name'],
            'medium': medium_a['name']
        })
        Org.remove_medium({'id': self.org['id'], 'medium-id': medium_b['id']})
        org_info = Org.info({'id': self.org['id']})
        self.assertNotIn(medium_a['name'], org_info['installation-media'],
                         "Failed to remove medium by name")
        self.assertNotIn(medium_b['name'], org_info['installation-media'],
                         "Failed to remove medium by id")
Beispiel #3
0
    def test_positive_add_and_remove_media(self):
        """Add and remove medium to organization

        :id: c2943a81-c8f7-44c4-926b-388055d7c290

        :expectedresults: Media are handled as expected

        :bz: 1395229

        :steps:
            1. add and remove medium by id
            2. add and remove medium by name

        :CaseLevel: Integration
        """
        org = make_org()
        medium_a = make_medium()
        medium_b = make_medium()
        Org.add_medium({
            'id': org['id'],
            'medium-id': medium_a['id'],
        })
        Org.add_medium({
            'name': org['name'],
            'medium': medium_b['name'],
        })
        org_info = Org.info({'id': org['id']})
        self.assertIn(medium_a['name'], org_info['installation-media'],
                      "Failed to add medium by id")
        self.assertIn(medium_b['name'], org_info['installation-media'],
                      "Failed to add medium by name")
        Org.remove_medium({
            'name': org['name'],
            'medium': medium_a['name'],
        })
        Org.remove_medium({
            'id': org['id'],
            'medium-id': medium_b['id'],
        })
        org_info = Org.info({'id': org['id']})
        self.assertNotIn(medium_a['name'], org_info['installation-media'],
                         "Failed to remove medium by name")
        self.assertNotIn(medium_b['name'], org_info['installation-media'],
                         "Failed to remove medium by id")
    def test_positive_remove_medium_by_name(self):
        """Remove a medium from organization by its name

        @Feature: Organization

        @Assert: Medium is removed from the org
        """
        org = make_org()
        medium = make_medium()
        Org.add_medium({
            'name': org['name'],
            'medium': medium['name'],
        })
        Org.remove_medium({
            'name': org['name'],
            'medium': medium['name'],
        })
        org = Org.info({'id': org['id']})
        self.assertNotIn(medium['name'], org['installation-media'])
Beispiel #5
0
    def test_positive_remove_medium_by_id(self):
        """@Test: Add a compute resource and then remove it by its ID

        @Feature: Organization

        @Assert: Medium is removed from the org
        """
        org = make_org()
        medium = make_medium()
        Org.add_medium({
            'name': org['name'],
            'medium': medium['name']
        })
        Org.remove_medium({
            'name': org['name'],
            'medium': medium['name']
        })
        org = Org.info({'id': org['id']})
        self.assertNotIn(medium['name'], org['installation-media'])
Beispiel #6
0
    def test_positive_remove_medium_by_name(self):
        """Remove a medium from organization by its name

        @Feature: Organization

        @Assert: Medium is removed from the org
        """
        org = make_org()
        medium = make_medium()
        Org.add_medium({
            'name': org['name'],
            'medium': medium['name'],
        })
        Org.remove_medium({
            'name': org['name'],
            'medium': medium['name'],
        })
        org = Org.info({'id': org['id']})
        self.assertNotIn(medium['name'], org['installation-media'])
    def test_positive_remove_medium_by_name(self):
        """Remove a medium from organization by its name

        @id: feb6c092-3459-496d-a403-69b540ba469a

        @Assert: Medium is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        medium = make_medium()
        Org.add_medium({
            'name': org['name'],
            'medium': medium['name'],
        })
        Org.remove_medium({
            'name': org['name'],
            'medium': medium['name'],
        })
        org = Org.info({'id': org['id']})
        self.assertNotIn(medium['name'], org['installation-media'])
    def test_positive_remove_medium_by_id(self):
        """Remove a medium from organization by its ID

        @id: 703103d8-f4d4-4070-bd6b-1fd239a92fa5

        @Assert: Medium is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        medium = make_medium()
        Org.add_medium({
            'id': org['id'],
            'medium-id': medium['id'],
        })
        Org.remove_medium({
            'id': org['id'],
            'medium-id': medium['id'],
        })
        org = Org.info({'id': org['id']})
        self.assertNotIn(medium['name'], org['installation-media'])
Beispiel #9
0
    def test_positive_remove_medium_by_name(self):
        """Remove a medium from organization by its name

        @id: feb6c092-3459-496d-a403-69b540ba469a

        @Assert: Medium is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        medium = make_medium()
        Org.add_medium({
            'name': org['name'],
            'medium': medium['name'],
        })
        Org.remove_medium({
            'name': org['name'],
            'medium': medium['name'],
        })
        org = Org.info({'id': org['id']})
        self.assertNotIn(medium['name'], org['installation-media'])
Beispiel #10
0
    def test_positive_remove_medium_by_id(self):
        """Remove a medium from organization by its ID

        @id: 703103d8-f4d4-4070-bd6b-1fd239a92fa5

        @Assert: Medium is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        medium = make_medium()
        Org.add_medium({
            'id': org['id'],
            'medium-id': medium['id'],
        })
        Org.remove_medium({
            'id': org['id'],
            'medium-id': medium['id'],
        })
        org = Org.info({'id': org['id']})
        self.assertNotIn(medium['name'], org['installation-media'])