def test_22_set_externalInterfaces(request):
    depends(request, ['tc_chart_release'])
    global gateway
    gateway = GET('/network/general/summary/').json()['default_routes'][0]
    payload = {
        'values': {
            'externalInterfaces': [
                {
                    'hostInterface': f'{interface}',
                    'ipam': {
                        'type': 'static',
                        'staticIPConfigurations': [f'{ip}/24'],
                        'staticRoutes': [
                            {
                                'destination': '0.0.0.0/0',
                                'gateway': gateway
                            }
                        ]
                    }
                }
            ]
        }
    }
    results = PUT(f'/chart/release/id/{tc_release_id}/', payload)
    assert results.status_code == 200, results.text
    assert isinstance(results.json(), int), results.text
    job_status = wait_on_job(results.json(), 300)
    assert job_status['state'] == 'SUCCESS', str(job_status['results'])
Exemple #2
0
def test_28_change_truecommand_ix_chart_updatestrategy_to_recreate(request):
    depends(request, ['tc_chart_release'])
    payload = {'values': {'updateStrategy': 'Recreate'}}
    results = PUT(f'/chart/release/id/{tc_release_id}/', payload)
    assert results.status_code == 200, results.text
    assert isinstance(results.json(), int), results.text
    job_status = wait_on_job(results.json(), 300)
    assert job_status['state'] == 'SUCCESS', str(job_status['results'])
def test_02_change_enable_image_updates_to_false():
    payload = {
        'enable_image_updates': False
    }
    results = PUT('/container/', payload)
    assert results.status_code == 200, results.text
    assert isinstance(results.json(), dict), results.text
    assert results.json()['enable_image_updates'] is False, results.text
Exemple #4
0
 def test_08_set_main_interface_ipv4_to_false():
     payload = {
         'ipv4_dhcp': False,
         "aliases": [{
             'address': ip,
             'netmask': aliases['netmask']
         }]
     }
     results = PUT(f'/interface/id/{interface}/', payload)
     assert results.status_code == 200, results.text
     assert isinstance(results.json(), dict) is True, results.text
     assert results.json()['ipv4_dhcp'] is False, results.text
Exemple #5
0
def test_08_set_main_interface_ipv4_to_false():
    payload = {
        'ipv4_dhcp': False,
        "aliases": [
            {
                'address': ip,
                'netmask': aliases['netmask']
            }
        ]
    }
    results = PUT(f'/interface/id/{interface}/', payload)
    assert results.status_code == 200, results.text
    assert isinstance(results.json(), dict) is True, results.text
    assert results.json()['ipv4_dhcp'] is False, results.text
def test_08_set_main_interface_ipv4_to_false():
    payload = {
        'ipv4_dhcp': False,
        "aliases": [{
            'address': ip,
            'netmask': aliases['netmask']
        }]
    }

    if any([ha, scale]) is False:
        payload['disable_offload_capabilities'] = True
    results = PUT(f'/interface/id/{interface}/', payload)
    assert results.status_code == 200, results.text
    assert isinstance(results.json(), dict) is True, results.text
    assert results.json()['ipv4_dhcp'] is False, results.text
Exemple #7
0
def test_08_system_advanced_set_motd():
    results = PUT('/system/advanced/', {
        'motd': MOTD
    })
    assert results.status_code == 200, results.text
    data = results.json()
    assert isinstance(data, dict), data
Exemple #8
0
 def test_37_set_truecommand_ix_chart_volumes(request):
     depends(request, ['tc_chart_release'])
     global payload
     payload = {
         'values': {
             'volumes': [{
                 'mountPath': '/mnt',
                 'datasetName': 'tc-mountpath'
             }]
         }
     }
     results = PUT(f'/chart/release/id/{tc_release_id}/', payload)
     assert results.status_code == 200, results.text
     assert isinstance(results.json(), int), results.text
     job_status = wait_on_job(results.json(), 300)
     assert job_status['state'] == 'SUCCESS', str(job_status['results'])
Exemple #9
0
    def test_15_set_interface_for_ha():
        payload = {
            'ipv4_dhcp':
            False,
            'failover_critical':
            True,
            'failover_vhid':
            vhid,
            'failover_group':
            1,
            "aliases": [{
                'type': 'INET',
                'address': controller1_ip,
                'netmask': 23
            }],
            'failover_aliases': [{
                'type': 'INET',
                'address': controller2_ip,
            }],
            'failover_virtual_aliases': [{
                'type': 'INET',
                'address': virtual_ip,
            }],
        }

        results = PUT(f'/interface/id/{interface}/', payload, controller_a=ha)
        assert results.status_code == 200, results.text
        global interfaces_id
        interfaces_id = results.json()['id']
Exemple #10
0
def test_63_re_enable_activedirectory(request):
    depends(request, ["pool_04", "ad_01", "ad_02", "ad_10"], scope="session")
    global payload, results, job_id
    payload = {"enable": True}
    results = PUT("/activedirectory/", payload)
    assert results.status_code == 200, results.text
    job_id = results.json()['job_id']
Exemple #11
0
 def test_26_set_truecommand_ix_chart_portforwarding(request):
     depends(request, ['tc_chart_release'])
     payload = {
         'values': {
             'portForwardingList': [{
                 'containerPort': 80,
                 'nodePort': 20345,
                 'protocol': 'TCP'
             }]
         }
     }
     results = PUT(f'/chart/release/id/{tc_release_id}/', payload)
     assert results.status_code == 200, results.text
     assert isinstance(results.json(), int), results.text
     job_status = wait_on_job(results.json(), 300)
     assert job_status['state'] == 'SUCCESS', str(job_status['results'])
Exemple #12
0
def test_06_system_advanced_disable_serial_port():
    results = PUT('/system/advanced/', {
        'serialconsole': False,
    })
    assert results.status_code == 200, results.text
    data = results.json()
    assert isinstance(data, dict), data
Exemple #13
0
def test_15_change_truechart_preferred_trains():
    payload = {
        'preferred_trains': ['test']
    }
    results = PUT('/catalog/id/TRUECHARTS/', payload)
    assert results.status_code == 200, results.text
    assert isinstance(results.json(), dict), results.text
Exemple #14
0
def test_01_enable_and_verify_service(svc):
    results = PUT(f'/service/id/{all_services[svc]["id"]}/', {'enable': True})
    assert results.status_code == 200, results.text

    results = GET(f'/service/id/{all_services[svc]["id"]}/')
    assert results.status_code == 200, results.text
    assert results.json()['enable'], results.text
Exemple #15
0
def test_06_system_advanced_disable_serial_port():
    results = PUT('/system/advanced/', {
        'serialconsole': False,
    })
    assert results.status_code == 200, results.text
    data = results.json()
    assert isinstance(data, dict), data
Exemple #16
0
def test_21_change_some_ipfs_schema_values(request):
    depends(request, ['release_ipfs', 'hostPath_dataset'])
    global payload
    payload = {
        'values': {
            'updateStrategy': 'RollingUpdate',
            'service': {
                'swarmPort': 10401,
                'apiPort': 10501,
                'gatewayPort': 10880
            },
            'appVolumeMounts': {
                'staging': {
                    'datasetName': 'ix-ipfs-staging',
                    'mountPath': '/export',
                    'hostPathEnabled': True,
                    'hostPath': f'/mnt/{pool_name}/ipfs-staging'
                },
                'data': {
                    'datasetName': 'ix-ipfs-data',
                    'mountPath': '/data/ipfs',
                    'hostPathEnabled': True,
                    'hostPath': f'/mnt/{pool_name}/ipfs-data'
                }
            }
        }
    }
    results = PUT(f'/chart/release/id/{release_id}/', payload)
    assert results.status_code == 200, results.text
    job_status = wait_on_job(results.json(), 300)
    assert job_status['state'] == 'SUCCESS', str(job_status['results'])
Exemple #17
0
def test_09_update_jail_description():
    global JAIL_NAME

    results = PUT(f'/jail/id/{JAIL_NAME}/', {'name': JAIL_NAME + '_renamed'})
    assert results.status_code == 200, results.text
    assert results.json() is True, results.text
    JAIL_NAME += '_renamed'
def test_32_set_truecommand_ix_chart_livenessProbe(request):
    depends(request, ['tc_chart_release'])
    payload = {
        'values': {
            'livenessProbe': {
                'command': ['ls /usr/share'],
                'initialDelaySeconds': 10,
                'periodSeconds': 15
            }
        }
    }
    results = PUT(f'/chart/release/id/{tc_release_id}/', payload)
    assert results.status_code == 200, results.text
    assert isinstance(results.json(), int), results.text
    job_status = wait_on_job(results.json(), 300)
    assert job_status['state'] == 'SUCCESS', str(job_status['results'])
def test_08_system_advanced_set_motd():
    results = PUT('/system/advanced/', {
        'motd': MOTD
    })
    assert results.status_code == 200, results.text
    data = results.json()
    assert isinstance(data, dict), data
Exemple #20
0
def test_04_disable_tuneable():
    results = PUT(
       f'/tunable/id/{TUNABLE_ID}', {
            'enabled': False
        }
    )

    assert results.json()['enabled'] is False, results.text
Exemple #21
0
def test_56_re_enable_activedirectory(request):
    depends(request, ["ad_dataset_permission"], scope="session")
    global payload, results
    payload = {"enable": True}
    results = PUT("/activedirectory/", payload)
    assert results.status_code == 200, results.text
    job_status = wait_on_job(results.json()['job_id'], 180)
    assert job_status['state'] == 'SUCCESS', str(job_status['results'])
Exemple #22
0
def test_13_change_tunable_comment():
    global payload, results
    payload = {
        "tun_comment": "New tunable dummynet tests",
    }
    results = PUT(f"/system/tunable/{tunable_id}/", payload)
    assert results.status_code == 200, results.text
    assert isinstance(results.json(), dict) is True, results.text
Exemple #23
0
def test_079_change_timemachine_to_true():
    global vuid
    payload = {
        'timemachine': True,
    }
    results = PUT(f"/sharing/smb/id/{smb_id}/", payload)
    assert results.status_code == 200, results.text
    vuid = results.json()['vuid']
Exemple #24
0
def test_084_change_recyclebin_to_true():
    global vuid
    payload = {
        "recyclebin": True,
    }
    results = PUT(f"/sharing/smb/id/{smb_id}", payload)
    assert results.status_code == 200, results.text
    vuid = results.json()['vuid']
Exemple #25
0
def test_02_disable_and_verify_service(svc, request):
    depends(request, ['ENABLE'])
    results = PUT(f'/service/id/{all_services[svc]["id"]}/', {'enable': False})
    assert results.status_code == 200, results.text

    results = GET(f'/service/id/{all_services[svc]["id"]}/')
    assert results.status_code == 200, results.text
    assert not results.json()['enable'], results.text
Exemple #26
0
def test_12_change_tunable_comment():
    global payload, results
    payload = {
        "tun_comment": "New tunable dummynet tests",
    }
    results = PUT(f"/system/tunable/{tunable_id}/", payload)
    assert results.status_code == 200, results.text
    assert isinstance(results.json(), dict) is True, results.text
Exemple #27
0
def test_02_set_nameserver_for_ad(request):
    depends(request, ["pool_04"], scope="session")
    global payload
    payload = {"nameserver1": '8.8.8.8', "nameserver2": '8.8.4.4'}
    global results
    results = PUT("/network/configuration/", payload)
    assert results.status_code == 200, results.text
    assert isinstance(results.json(), dict), results.text
Exemple #28
0
def test_03_system_advanced_set_serial_port(sysadv_dict):
    results = PUT('/system/advanced/', {
        'serialconsole': True,
        'serialport': sysadv_dict['serial_choices'][0],
    })
    assert results.status_code == 200, results.text
    data = results.json()
    assert isinstance(data, dict), data
Exemple #29
0
def test_03_system_advanced_set_serial_port(sysadv_dict):
    results = PUT('/system/advanced/', {
        'serialconsole': True,
        'serialport': sysadv_dict['serial_choices'][0],
    })
    assert results.status_code == 200, results.text
    data = results.json()
    assert isinstance(data, dict), data
Exemple #30
0
def test_11_update_jail_description():
    if freeze is True:
        pytest.skip(freeze_msg)
    global JAIL_NAME
    results = PUT(f'/jail/id/{JAIL_NAME}/', {'name': JAIL_NAME + '_renamed'})
    assert results.status_code == 200, results.text
    assert results.json() is True, results.text
    JAIL_NAME += '_renamed'
Exemple #31
0
def test_08_update_jail_description():
    global JAIL_NAME

    result = PUT(f'/jail/id/{JAIL_NAME}', {'name': JAIL_NAME + '_renamed'})

    assert result.json() is True, result.text

    JAIL_NAME += '_renamed'
Exemple #32
0
def test_07_update_disk_description():
    updated_description = 'Updated description'
    results = PUT(
        f'/disk/id/{DISK_ID}/', {
            'description': updated_description
        }
    )
    assert results.status_code == 200, results.text
    assert results.json()['description'] == updated_description, results.text
Exemple #33
0
def test_03_Configuring_TFTP_service():
    payload = {
        "directory": "/mnt/tank/tftproot",
        "username": "******",
        "newfiles": True
    }
    results = PUT("/tftp/", payload)

    assert isinstance(results.json(), dict), results.text
Exemple #34
0
def test_03_Configuring_TFTP_service():
    payload = {
        "directory": f"/mnt/{pool_name}/tftproot",
        "username": "******",
        "newfiles": True
    }
    results = PUT("/tftp/", payload)

    assert isinstance(results.json(), dict), results.text
Exemple #35
0
def test_039_change_recyclebin_to_true(request):
    depends(request, ["service_cifs_running"], scope="session")
    global vuid
    payload = {
        "recyclebin": True,
    }
    results = PUT(f"/sharing/smb/id/{smb_id}", payload)
    assert results.status_code == 200, results.text
    vuid = results.json()['vuid']
Exemple #36
0
def test_14_update_disk_description():
    updated_description = 'Updated description'
    results = PUT(
        f'/disk/id/{DISK_ID}/', {
            'description': updated_description
        }
    )
    assert results.status_code == 200, results.text
    assert results.json()['description'] == updated_description, results.text
Exemple #37
0
def test_15_update_disk_password():
    new_passwd = 'freenas'
    results = PUT(
        f'/disk/id/{DISK_ID}', {
            'passwd': new_passwd
        }
    )
    assert results.status_code == 200, results.text
    assert results.json()['passwd'] == new_passwd
Exemple #38
0
def test_15_update_disk_password():
    new_passwd = 'freenas'
    result = PUT(
        f'/disk/id/{DISK_ID}', {
            'passwd': new_passwd
        }
    )

    assert result.json()['passwd'] == new_passwd
Exemple #39
0
def test_14_update_disk_description():
    updated_description = 'Updated description'
    result = PUT(
        f'/disk/id/{DISK_ID}', {
            'description': updated_description
        }
    )

    assert result.json()['description'] == updated_description, result.text
Exemple #40
0
def test_079_change_timemachine_to_true(request):
    depends(request, ["permissions_job", "service_cifs_running"], scope="session")
    global vuid
    payload = {
        'timemachine': True,
    }
    results = PUT(f"/sharing/smb/id/{smb_id}/", payload)
    assert results.status_code == 200, results.text
    vuid = results.json()['vuid']
Exemple #41
0
def test_02_configure_setting_domain_hostname_and_dns():
    global payload
    payload = {"domain": domain,
               "hostname": hostname,
               "ipv4gateway": gateway,
               "nameserver1": BRIDGEDNS}
    global results
    results = PUT("/network/configuration/", payload)
    assert results.status_code == 200, results.text
    assert isinstance(results.json(), dict), results.text
Exemple #42
0
def test_23_change_system_advanced_parameter():
    global payload, results
    payload = {
        "adv_motd": "Welcome to iXsystems",
        "adv_powerdaemon": True,
        "adv_advancedmode": True
    }
    results = PUT("/system/advanced/", payload)
    assert results.status_code == 200, results.text
    assert isinstance(results.json(), dict) is True, results.text
Exemple #43
0
def test_08_update_jail_description():
    global JAIL_NAME

    result = PUT(
        f'/jail/id/{JAIL_NAME}', {
            'name': JAIL_NAME + '_renamed'
        }
    )

    assert result.json() is True, result.text

    JAIL_NAME += '_renamed'
Exemple #44
0
def test_09_update_jail_description():
    if freeze is True:
        pytest.skip(freeze_msg)

    global JAIL_NAME
    results = PUT(
        f'/jail/id/{JAIL_NAME}/', {
            'name': JAIL_NAME + '_renamed'
        }
    )
    assert results.status_code == 200, results.text
    assert results.json() is True, results.text
    JAIL_NAME += '_renamed'
Exemple #45
0
def test_05_updating_variable_name_value_comment_type():
    payload = {
        'var': VARIABLE + '1',
        'value': 'temp',
        'comment': 'testing variable',
        'type': 'RC',
        'enabled': True
    }

    results = PUT(
        f'/tunable/id/{TUNABLE_ID}/',
        payload
    )
    j_resp = results.json()
    payload['id'] = TUNABLE_ID

    assert j_resp == payload, results.text
Exemple #46
0
def test_02_Setting_timezone():
    payload = {"stg_timezone": "America/New_York"}
    results = PUT("/system/settings/", payload)
    assert results.status_code == 200, results.text
    assert isinstance(results.json(), dict) is True, results.text