コード例 #1
0
    def test_positive_add_and_remove_subnets(self):
        """add and remove a subnet from organization

        :id: adb5310b-76c5-4aca-8220-fdf0fe605cb0

        :BZ:
            1. Add and remove subnet by name
            2. Add and remove subnet by id

        :expectedresults: Subnets are handled as expected

        :BZ: 1395229

        :CaseLevel: Integration
        """
        subnet_a = make_subnet()
        subnet_b = make_subnet()
        Org.add_subnet({'name': self.org['name'], 'subnet': subnet_a['name']})
        Org.add_subnet({'name': self.org['name'], 'subnet-id': subnet_b['id']})
        org_info = Org.info({'id': self.org['id']})
        self.assertEqual(len(org_info['subnets']), 2, "Failed to add subnets")
        Org.remove_subnet({
            'name': self.org['name'],
            'subnet': subnet_a['name']
        })
        Org.remove_subnet({
            'name': self.org['name'],
            'subnet-id': subnet_b['id']
        })
        org_info = Org.info({'id': self.org['id']})
        self.assertEqual(len(org_info['subnets']), 0,
                         "Failed to remove subnets")
コード例 #2
0
ファイル: test_organization.py プロジェクト: jhutar/robottelo
    def test_positive_add_and_remove_subnets(self):
        """add and remove a subnet from organization

        :id: adb5310b-76c5-4aca-8220-fdf0fe605cb0

        :bz:
            1. Add and remove subnet by name
            2. Add and remove subnet by id

        :expectedresults: Subnets are handled as expected

        :bz: 1395229

        :CaseLevel: Integration
        """
        org = make_org()
        subnet_a = make_subnet()
        subnet_b = make_subnet()
        Org.add_subnet({
            'name': org['name'],
            'subnet': subnet_a['name'],
        })
        Org.add_subnet({
            'name': org['name'],
            'subnet-id': subnet_b['id'],
        })
        org_info = Org.info({'id': org['id']})
        self.assertEqual(len(org_info['subnets']), 2,
                         "Failed to add subnets")
        Org.remove_subnet({
            'name': org['name'],
            'subnet': subnet_a['name'],
        })
        Org.remove_subnet({
            'name': org['name'],
            'subnet-id': subnet_b['id'],
        })
        org_info = Org.info({'id': org['id']})
        self.assertEqual(len(org_info['subnets']), 0,
                         "Failed to remove subnets")
コード例 #3
0
    def test_positive_remove_subnet_by_id(self):
        """Remove a subnet from organization by its ID

        @Feature: Organization

        @Assert: Subnet is removed from the org
        """
        org = make_org()
        subnet = make_subnet()
        Org.add_subnet({
            'name': org['name'],
            'subnet': subnet['name'],
        })
        org = Org.info({'id': org['id']})
        self.assertEqual(len(org['subnets']), 1)
        self.assertIn(subnet['name'], org['subnets'][0])
        Org.remove_subnet({
            'name': org['name'],
            'subnet-id': subnet['id'],
        })
        org = Org.info({'id': org['id']})
        self.assertEqual(len(org['subnets']), 0)
コード例 #4
0
    def test_positive_remove_subnet_by_name(self):
        """@Test: Add a subnet and then remove it by its name

        @Feature: Organization

        @Assert: Subnet is removed from the org
        """
        org = make_org()
        subnet = make_subnet()
        Org.add_subnet({
            'name': org['name'],
            'subnet': subnet['name'],
        })
        org = Org.info({'id': org['id']})
        self.assertEqual(len(org['subnets']), 1)
        self.assertIn(subnet['name'], org['subnets'][0])
        Org.remove_subnet({
            'name': org['name'],
            'subnet': subnet['name'],
        })
        org = Org.info({'id': org['id']})
        self.assertEqual(len(org['subnets']), 0)
コード例 #5
0
    def test_positive_remove_subnet_by_id(self):
        """Remove a subnet from organization by its ID

        @Feature: Organization

        @Assert: Subnet is removed from the org
        """
        org = make_org()
        subnet = make_subnet()
        Org.add_subnet({
            'name': org['name'],
            'subnet': subnet['name'],
        })
        org = Org.info({'id': org['id']})
        self.assertEqual(len(org['subnets']), 1)
        self.assertIn(subnet['name'], org['subnets'][0])
        Org.remove_subnet({
            'name': org['name'],
            'subnet-id': subnet['id'],
        })
        org = Org.info({'id': org['id']})
        self.assertEqual(len(org['subnets']), 0)
コード例 #6
0
def test_positive_add_and_remove_subnets(module_org):
    """add and remove a subnet from organization

    :id: adb5310b-76c5-4aca-8220-fdf0fe605cb0

    :BZ:
        1. Add and remove subnet by name
        2. Add and remove subnet by id

    :expectedresults: Subnets are handled as expected

    :BZ: 1395229

    :CaseLevel: Integration
    """
    subnets = [make_subnet() for _ in range(0, 2)]
    Org.add_subnet({'name': module_org.name, 'subnet': subnets[0]['name']})
    Org.add_subnet({'name': module_org.name, 'subnet-id': subnets[1]['id']})
    org_info = Org.info({'id': module_org.id})
    assert len(org_info['subnets']) == 2, "Failed to add subnets"
    Org.remove_subnet({'name': module_org.name, 'subnet': subnets[0]['name']})
    Org.remove_subnet({'name': module_org.name, 'subnet-id': subnets[1]['id']})
    org_info = Org.info({'id': module_org.id})
    assert len(org_info['subnets']) == 0, "Failed to remove subnets"
コード例 #7
0
    def test_positive_remove_subnet_by_id(self):
        """Remove a subnet from organization by its ID

        @id: 4868ef18-983a-48b4-940a-e1b55f01f0b6

        @Assert: Subnet is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        subnet = make_subnet()
        Org.add_subnet({
            'name': org['name'],
            'subnet': subnet['name'],
        })
        org = Org.info({'id': org['id']})
        self.assertEqual(len(org['subnets']), 1)
        self.assertIn(subnet['name'], org['subnets'][0])
        Org.remove_subnet({
            'name': org['name'],
            'subnet-id': subnet['id'],
        })
        org = Org.info({'id': org['id']})
        self.assertEqual(len(org['subnets']), 0)
コード例 #8
0
    def test_positive_remove_subnet_by_name(self):
        """Remove a subnet from organization by its name

        @id: adb5310b-76c5-4aca-8220-fdf0fe605cb0

        @Assert: Subnet is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        subnet = make_subnet()
        Org.add_subnet({
            'name': org['name'],
            'subnet': subnet['name'],
        })
        org = Org.info({'id': org['id']})
        self.assertEqual(len(org['subnets']), 1)
        self.assertIn(subnet['name'], org['subnets'][0])
        Org.remove_subnet({
            'name': org['name'],
            'subnet': subnet['name'],
        })
        org = Org.info({'id': org['id']})
        self.assertEqual(len(org['subnets']), 0)
コード例 #9
0
    def test_positive_remove_subnet_by_id(self):
        """Remove a subnet from organization by its ID

        @id: 4868ef18-983a-48b4-940a-e1b55f01f0b6

        @Assert: Subnet is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        subnet = make_subnet()
        Org.add_subnet({
            'name': org['name'],
            'subnet': subnet['name'],
        })
        org = Org.info({'id': org['id']})
        self.assertEqual(len(org['subnets']), 1)
        self.assertIn(subnet['name'], org['subnets'][0])
        Org.remove_subnet({
            'name': org['name'],
            'subnet-id': subnet['id'],
        })
        org = Org.info({'id': org['id']})
        self.assertEqual(len(org['subnets']), 0)
コード例 #10
0
    def test_positive_remove_subnet_by_name(self):
        """Remove a subnet from organization by its name

        @id: adb5310b-76c5-4aca-8220-fdf0fe605cb0

        @Assert: Subnet is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        subnet = make_subnet()
        Org.add_subnet({
            'name': org['name'],
            'subnet': subnet['name'],
        })
        org = Org.info({'id': org['id']})
        self.assertEqual(len(org['subnets']), 1)
        self.assertIn(subnet['name'], org['subnets'][0])
        Org.remove_subnet({
            'name': org['name'],
            'subnet': subnet['name'],
        })
        org = Org.info({'id': org['id']})
        self.assertEqual(len(org['subnets']), 0)