def test_module_parameters_mgmt_address_subnet(self):
        args = dict(mgmt_network='bridged',
                    mgmt_address='1.2.3.4/255.255.255.0')

        p = Parameters(params=args)
        assert p.mgmt_network == 'bridged'
        assert p.mgmt_address == '1.2.3.4/24'
    def test_module_parameters_vcmp_software_image_facts(self):
        # vCMP images may include a forward slash in their names. This is probably
        # related to the slots on the system, but it is not a valid value to specify
        # that slot when providing an initial image
        args = dict(initial_image='BIGIP-12.1.0.1.0.1447-HF1.iso/1', )

        p = Parameters(params=args)
        assert p.initial_image == 'BIGIP-12.1.0.1.0.1447-HF1.iso/1'
    def test_module_parameters(self):
        args = dict(initial_image='BIGIP-12.1.0.1.0.1447-HF1.iso',
                    mgmt_network='bridged',
                    mgmt_address='1.2.3.4/24',
                    vlans=['vlan1', 'vlan2'])

        p = Parameters(params=args)
        assert p.initial_image == 'BIGIP-12.1.0.1.0.1447-HF1.iso'
        assert p.mgmt_network == 'bridged'
    def test_api_parameters(self):
        args = dict(initialImage="BIGIP-tmos-tier2-13.1.0.0.0.931.iso",
                    managementGw="2.2.2.2",
                    managementIp="1.1.1.1/24",
                    managementNetwork="bridged",
                    state="deployed",
                    vlans=["/Common/vlan1", "/Common/vlan2"])

        p = Parameters(params=args)
        assert p.initial_image == 'BIGIP-tmos-tier2-13.1.0.0.0.931.iso'
        assert p.mgmt_route == '2.2.2.2'
        assert p.mgmt_address == '1.1.1.1/24'
        assert '/Common/vlan1' in p.vlans
        assert '/Common/vlan2' in p.vlans
    def test_module_parameters_mgmt_route(self):
        args = dict(mgmt_route='1.2.3.4')

        p = Parameters(params=args)
        assert p.mgmt_route == '1.2.3.4'
    def test_module_parameters_mgmt_bridged_without_subnet(self):
        args = dict(mgmt_network='bridged', mgmt_address='1.2.3.4')

        p = Parameters(params=args)
        assert p.mgmt_network == 'bridged'
        assert p.mgmt_address == '1.2.3.4/32'
    def test_module_parameters_mgmt_address_cidr(self):
        args = dict(mgmt_network='bridged', mgmt_address='1.2.3.4/24')

        p = Parameters(args)
        assert p.mgmt_network == 'bridged'
        assert p.mgmt_address == '1.2.3.4/24'