How to use the pyvcloud.system_test_framework.environment.Environment.get_config function in pyvcloud

To help you get started, we’ve selected a few pyvcloud examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vmware / vcd-cli / system_tests / gateway_tests.py View on Github external
def test_0020_update_rate_limit(self):
        """Updates existing rate limit of gateway.
         It will trigger the cli command configure-rate-limits list
        """
        self._config = Environment.get_config()
        config = self._config['external_network']
        ext_name = config['name']
        result = self._runner.invoke(
            gateway,
            args=[
                'configure-rate-limits', 'list', self._name
            ])
        self.assertEqual(0, result.exit_code)
github vmware / vcd-cli / system_tests / role_tests.py View on Github external
def test_0000_setup(self):
        self._config = Environment.get_config()
        TestRole._logger = Environment.get_default_logger()
        TestRole._runner = CliRunner()
        self._sys_login()
github vmware / vcd-cli / system_tests / vdc_tests.py View on Github external
def test_0000_setup(self):
        """Setup the org vdc required for the other tests in this module.
        """
        TestOrgVDC._config = Environment.get_config()
        logger = Environment.get_default_logger()
        TestOrgVDC._client = Environment.get_client_in_default_org(
            CommonRoles.ORGANIZATION_ADMINISTRATOR)
        TestOrgVDC._runner = CliRunner()
        default_org = TestOrgVDC._config['vcd']['default_org_name']
        TestOrgVDC._login(self)
        TestOrgVDC._runner.invoke(org, ['use', default_org])
        TestOrgVDC._vdc_resource = Environment.get_test_vdc(
            TestOrgVDC._client).get_resource()
        TestOrgVDC._vdc1 = VDC(TestOrgVDC._client,
                               href=TestOrgVDC._vdc_resource.get('href'))
        # Create Independent disk
        TestOrgVDC._idisk_id = \
            create_independent_disk(client=TestOrgVDC._client,
                                    vdc=TestOrgVDC._vdc1,
                                    name=self._idisk_name,
github vmware / vcd-cli / system_tests / vapp_network_dhcp_tests.py View on Github external
def test_0000_setup(self):
        self._config = Environment.get_config()
        TestVappDhcp._logger = Environment.get_default_logger()
        TestVappDhcp._client = Environment.get_sys_admin_client()
        TestVappDhcp._runner = CliRunner()
        default_org = self._config['vcd']['default_org_name']
        self._login()
        TestVappDhcp._runner.invoke(org, ['use', default_org])
        vapp = Environment.get_test_vapp_with_network(TestVappDhcp._client)
        self.assertIsNotNone(vapp)
github vmware / vcd-cli / system_tests / gateway_tests.py View on Github external
def test_0017_add_sub_allocated_ip_pools(self):
        """Adds new ip range present to the sub allocate pool of gateway.
         It will trigger the cli command sub-allocate-ip add
        """
        self._config = Environment.get_config()
        config = self._config['external_network']
        gateway_sub_allocated_ip_range = \
            config['gateway_sub_allocated_ip_range']
        ext_name = config['name']
        result = self._runner.invoke(
            gateway,
            args=[
                'sub-allocate-ip', 'add', self._name, '-e', ext_name,
                '--ip-range', gateway_sub_allocated_ip_range
            ])
        self.assertEqual(0, result.exit_code)
github vmware / pyvcloud / system_tests / dhcp_tests.py View on Github external
def test_0000_setup(self):
        """Add DHCP pool in the gateway.

        Invokes the add_dhcp_pool of the gateway.
        """
        TestDhcp._client = Environment.get_sys_admin_client()
        TestDhcp._config = Environment.get_config()
        gateway = Environment. \
            get_test_gateway(TestDhcp._client)
        gateway_obj = Gateway(TestDhcp._client,
                              TestDhcp._name,
                              href=gateway.get('href'))
        gateway_obj.add_dhcp_pool(TestDhcp._pool_ip_range)
        dhcp_resource = gateway_obj.get_dhcp()
        # Verify
        matchFound = False
        for ipPool in dhcp_resource.ipPools.ipPool:
            if ipPool.ipRange.text == TestDhcp._pool_ip_range:
                matchFound = True
                break
        self.assertTrue(matchFound)
github vmware / vcd-cli / system_tests / firewall_rule_tests.py View on Github external
def test_0000_setup(self):

        self._config = Environment.get_config()
        TestFirewallRule._logger = Environment.get_default_logger()
        TestFirewallRule._client = Environment.get_sys_admin_client()
        TestFirewallRule._runner = CliRunner()
        default_org = self._config['vcd']['default_org_name']
        TestFirewallRule._ext_nw = self._config['external_network']['name']
        self._login()
        TestFirewallRule._runner.invoke(org, ['use', default_org])
        result = TestFirewallRule._runner.invoke(
            gateway,
            args=[
                'services', 'firewall', 'create', TestFirewallRule.__name,
                '--name', TestFirewallRule.__firewall_rule_name, '--action',
                'accept', '--type', 'User', '--enabled', '--logging-enabled'
            ])
        self.assertEqual(0, result.exit_code)
        gateway_res = Environment.get_test_gateway(TestFirewallRule._client)
github vmware / pyvcloud / system_tests / client_tests.py View on Github external
def setUp(self):
        self._config = Environment.get_config()
        self._host = self._config['vcd']['host']
        self._org = self._config['vcd']['sys_org_name']
        self._user = self._config['vcd']['sys_admin_username']
        self._pass = self._config['vcd']['sys_admin_pass']

        self._logger = Environment.get_default_logger()
github vmware / pyvcloud / system_tests / vc_tests.py View on Github external
def test_0000_setup(self):
        # TODO(): need more pipeline work before this test can actually be run
        TestVC._client = Environment.get_sys_admin_client()
        TestVC._config = Environment.get_config()
        TestVC._vcenter_host_name = self._config['vc']['vcenter_host_name']
        TestVC._vcenter_invalid = 'xyz'
        TestVC._vcServerName = self._config['vc']['vcServerName']
        TestVC._vcServerHost = self._config['vc']['vcServerHost']
        TestVC._vcAdminUser = self._config['vc']['vcAdminUser']
        TestVC._vcAdminPwd = self._config['vc']['vcAdminPwd']
        TestVC._NSXServerName = self._config['vc']['NSXServerName']
        TestVC._NSXHost = self._config['vc']['NSXHost']
        TestVC._NSXAdminUser = self._config['vc']['NSXAdminUser']
        TestVC._NSXAdminPwd = self._config['vc']['NSXAdminPwd']
        TestVC._isEnabled = False
github vmware / vcd-cli / system_tests / extnet_tests.py View on Github external
def setUp(self):
        """Load configuration and create a click runner to invoke CLI."""
        self._config = Environment.get_config()
        self._logger = Environment.get_default_logger()

        self._runner = CliRunner()
        self._login()