Пример #1
0
    def test_0027_add_dhcp_binding(self):
        """Add DHCP Binding in the gateway.

         Invokes the add_dhcp_binding of the gateway.
        """
        gateway_obj = Gateway(
            TestGateway._client, self._name,
            Environment.get_test_gateway(
                Environment.get_sys_admin_client()).get('href'))
        gateway_obj.add_dhcp_binding(TestGateway._mac_address,
                                     TestGateway._host_name,
                                     TestGateway._binding_ip_address)
        dhcp_resource = gateway_obj.get_dhcp()
        # Verify
        matchFound = False
        for static_binding in dhcp_resource.staticBindings.staticBinding:
            if static_binding.macAddress.text == TestGateway._mac_address:
                matchFound = True
                break
        self.assertTrue(matchFound)
Пример #2
0
    def test_0105_add_dhcp_binding(self):
        """Add DHCP Binding in the gateway.

         Invokes the add_dhcp_binding of the gateway.
        """
        gateway_obj = Gateway(
            TestGateway._client, self._name,
            Environment.get_test_gateway(Environment.get_sys_admin_client())
            .get('href'))
        gateway_obj.add_dhcp_binding(TestGateway._mac_address,
                                     TestGateway._host_name,
                                     TestGateway._binding_ip_address)
        dhcp_resource = gateway_obj.get_dhcp()
        # Verify
        matchFound = False
        for static_binding in dhcp_resource.staticBindings.staticBinding:
            if static_binding.macAddress.text == TestGateway._mac_address:
                matchFound = True
                break
        self.assertTrue(matchFound)
Пример #3
0
    def test_0000_setup(self):
        """Add DHCP binding in the gateway.

        Invokes the add_dhcp_binding of the gateway.
        """
        TestDhcpBinding._client = Environment.get_sys_admin_client()
        TestDhcpBinding._config = Environment.get_config()
        gateway = Environment. \
            get_test_gateway(TestDhcpBinding._client)
        gateway_obj = Gateway(TestDhcpBinding._client,
                              TestDhcpBinding._name,
                              href=gateway.get('href'))
        gateway_obj.add_dhcp_binding(TestDhcpBinding._mac_address,
                                     TestDhcpBinding._host_name,
                                     TestDhcpBinding._binding_ip_address)
        dhcp_resource = gateway_obj.get_dhcp()
        # Verify
        matchFound = False
        for static_binding in dhcp_resource.staticBindings.staticBinding:
            if static_binding.hostname.text == TestDhcpBinding._host_name:
                matchFound = True
                break
        self.assertTrue(matchFound)