Ejemplo n.º 1
0
def test_positive_add_and_remove_capsules(proxy, module_org):
    """Add and remove a capsule from organization

    :id: 71af64ec-5cbb-4dd8-ba90-652e302305ec

    :expectedresults: Capsules are handled correctly

    :steps:
        1. add and remove capsule by ip
        2. add and remove capsule by name

    :CaseLevel: Integration
    """
    Org.add_smart_proxy({'id': module_org.id, 'smart-proxy-id': proxy['id']})
    org_info = Org.info({'name': module_org.name})
    assert proxy['name'] in org_info['smart-proxies'], "Failed to add capsule by id"
    Org.remove_smart_proxy({'id': module_org.id, 'smart-proxy-id': proxy['id']})
    org_info = Org.info({'id': module_org.id})
    assert proxy['name'] not in org_info['smart-proxies'], "Failed to remove capsule by id"
    Org.add_smart_proxy({'name': module_org.name, 'smart-proxy': proxy['name']})
    org_info = Org.info({'name': module_org.name})
    assert proxy['name'] in org_info['smart-proxies'], "Failed to add capsule by name"
    Org.remove_smart_proxy({'name': module_org.name, 'smart-proxy': proxy['name']})
    org_info = Org.info({'name': module_org.name})
    assert proxy['name'] not in org_info['smart-proxies'], "Failed to add capsule by name"
Ejemplo n.º 2
0
    def test_positive_remove_capsule_by_id(self):
        """Remove a capsule from organization by its id

        @id: 71af64ec-5cbb-4dd8-ba90-652e302305ec

        @Assert: Capsule is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        proxy = make_proxy()
        # Add capsule and org to cleanup list
        self.addCleanup(capsule_cleanup, proxy['id'])
        self.addCleanup(org_cleanup, org['id'])

        Org.add_smart_proxy({
            'id': org['id'],
            'smart-proxy-id': proxy['id'],
        })
        Org.remove_smart_proxy({
            'id': org['id'],
            'smart-proxy-id': proxy['id'],
        })
        org = Org.info({'id': org['id']})
        self.assertNotIn(proxy['name'], org['smart-proxies'])
Ejemplo n.º 3
0
    def test_positive_remove_capsule_by_name(self):
        """Remove a capsule from organization by its name

        @id: f56eaf46-fef5-4b52-819f-e30e61f0ec4a

        @Assert: Capsule is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        proxy = make_proxy()
        # Add capsule and org to cleanup list
        self.addCleanup(capsule_cleanup, proxy['id'])
        self.addCleanup(org_cleanup, org['id'])

        Org.add_smart_proxy({
            'name': org['name'],
            'smart-proxy': proxy['name'],
        })
        Org.remove_smart_proxy({
            'name': org['name'],
            'smart-proxy': proxy['name'],
        })
        org = Org.info({'name': org['name']})
        self.assertNotIn(proxy['name'], org['smart-proxies'])
Ejemplo n.º 4
0
    def test_positive_remove_capsule_by_name(self):
        """Remove a capsule from organization by its name

        @id: f56eaf46-fef5-4b52-819f-e30e61f0ec4a

        @Assert: Capsule is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        proxy = make_proxy()
        # Add capsule and org to cleanup list
        self.addCleanup(capsule_cleanup, proxy['id'])
        self.addCleanup(org_cleanup, org['id'])

        Org.add_smart_proxy({
            'name': org['name'],
            'smart-proxy': proxy['name'],
        })
        Org.remove_smart_proxy({
            'name': org['name'],
            'smart-proxy': proxy['name'],
        })
        org = Org.info({'name': org['name']})
        self.assertNotIn(proxy['name'], org['smart-proxies'])
Ejemplo n.º 5
0
    def test_positive_remove_capsule_by_id(self):
        """Remove a capsule from organization by its id

        @id: 71af64ec-5cbb-4dd8-ba90-652e302305ec

        @Assert: Capsule is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        proxy = make_proxy()
        # Add capsule and org to cleanup list
        self.addCleanup(capsule_cleanup, proxy['id'])
        self.addCleanup(org_cleanup, org['id'])

        Org.add_smart_proxy({
            'id': org['id'],
            'smart-proxy-id': proxy['id'],
        })
        Org.remove_smart_proxy({
            'id': org['id'],
            'smart-proxy-id': proxy['id'],
        })
        org = Org.info({'id': org['id']})
        self.assertNotIn(proxy['name'], org['smart-proxies'])
Ejemplo n.º 6
0
    def test_positive_remove_capsule_by_name(self):
        """Remove a capsule from organization by its name

        @Feature: Organization

        @Assert: Capsule is removed from the org
        """
        org = make_org()
        proxy = make_proxy()
        Org.add_smart_proxy({
            'name': org['name'],
            'smart-proxy': proxy['name'],
        })
        Org.remove_smart_proxy({
            'name': org['name'],
            'smart-proxy': proxy['name'],
        })
Ejemplo n.º 7
0
    def test_positive_add_and_remove_capsules(self):
        """Add and remove a capsule from organization

        :id: 71af64ec-5cbb-4dd8-ba90-652e302305ec

        :expectedresults: Capsules are handled correctly

        :steps:
            1. add and remove capsule by ip
            2. add and remove capsule by name

        :CaseLevel: Integration
        """
        org = make_org()
        proxy = self._make_proxy()
        self.addCleanup(org_cleanup, org['id'])
        Org.add_smart_proxy({
            'id': org['id'],
            'smart-proxy-id': proxy['id'],
        })
        org_info = Org.info({'name': org['name']})
        self.assertIn(proxy['name'], org_info['smart-proxies'],
                      "Failed to add capsule by id")
        Org.remove_smart_proxy({
            'id': org['id'],
            'smart-proxy-id': proxy['id'],
        })
        org_info = Org.info({'id': org['id']})
        self.assertNotIn(proxy['name'], org_info['smart-proxies'],
                         "Failed to remove capsule by id")
        Org.add_smart_proxy({
            'name': org['name'],
            'smart-proxy': proxy['name'],
        })
        org_info = Org.info({'name': org['name']})
        self.assertIn(proxy['name'], org_info['smart-proxies'],
                      "Failed to add capsule by name")
        Org.remove_smart_proxy({
            'name': org['name'],
            'smart-proxy': proxy['name'],
        })
        org_info = Org.info({'name': org['name']})
        self.assertNotIn(proxy['name'], org_info['smart-proxies'],
                         "Failed to add capsule by name")
Ejemplo n.º 8
0
    def test_positive_add_and_remove_capsules(self):
        """Add and remove a capsule from organization

        :id: 71af64ec-5cbb-4dd8-ba90-652e302305ec

        :expectedresults: Capsules are handled correctly

        :steps:
            1. add and remove capsule by ip
            2. add and remove capsule by name

        :CaseLevel: Integration
        """
        org = make_org()
        proxy = self._make_proxy()
        self.addCleanup(org_cleanup, org['id'])
        Org.add_smart_proxy({
            'id': org['id'],
            'smart-proxy-id': proxy['id'],
        })
        org_info = Org.info({'name': org['name']})
        self.assertIn(proxy['name'], org_info['smart-proxies'],
                      "Failed to add capsule by id")
        Org.remove_smart_proxy({
            'id': org['id'],
            'smart-proxy-id': proxy['id'],
        })
        org_info = Org.info({'id': org['id']})
        self.assertNotIn(proxy['name'], org_info['smart-proxies'],
                         "Failed to remove capsule by id")
        Org.add_smart_proxy({
            'name': org['name'],
            'smart-proxy': proxy['name'],
        })
        org_info = Org.info({'name': org['name']})
        self.assertIn(proxy['name'], org_info['smart-proxies'],
                      "Failed to add capsule by name")
        Org.remove_smart_proxy({
            'name': org['name'],
            'smart-proxy': proxy['name'],
        })
        org_info = Org.info({'name': org['name']})
        self.assertNotIn(proxy['name'], org_info['smart-proxies'],
                         "Failed to add capsule by name")
Ejemplo n.º 9
0
    def test_positive_remove_capsule_by_id(self):
        """Remove a capsule from organization by its id

        @Feature: Organization

        @Assert: Capsule is removed from the org
        """
        org = make_org()
        proxy = make_proxy()
        Org.add_smart_proxy({
            'id': org['id'],
            'smart-proxy-id': proxy['id'],
        })
        Org.remove_smart_proxy({
            'id': org['id'],
            'smart-proxy-id': proxy['id'],
        })
        org = Org.info({'id': org['id']})
        self.assertNotIn(proxy['name'], org['smart-proxies'])
Ejemplo n.º 10
0
    def test_positive_remove_capsule_by_name(self):
        """Remove a capsule from organization by its name

        @Feature: Organization

        @Assert: Capsule is removed from the org
        """
        org = make_org()
        proxy = make_proxy()
        Org.add_smart_proxy({
            'name': org['name'],
            'smart-proxy': proxy['name'],
        })
        Org.remove_smart_proxy({
            'name': org['name'],
            'smart-proxy': proxy['name'],
        })
        org = Org.info({'name': org['name']})
        self.assertNotIn(proxy['name'], org['smart-proxies'])